| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,6 +49,9 @@ identd_command_cb (char *word[], char *word_eol[], void *userdata) | |||
| 49 | 49 | { | |
| 50 | 50 | g_return_val_if_fail (responses != NULL, HEXCHAT_EAT_ALL); | |
| 51 | 51 | ||
| 52 | + if (service == NULL) /* If we are not running plugins can handle it */ | ||
| 53 | + return HEXCHAT_EAT_HEXCHAT; | ||
| 54 | + | ||
| 52 | 55 | if (word[2] && *word[2] && word[3] && *word[3]) | |
| 53 | 56 | { | |
| 54 | 57 | guint64 port = g_ascii_strtoull (word[2], NULL, 0); | |
@@ -65,7 +68,7 @@ identd_command_cb (char *word[], char *word_eol[], void *userdata) | |||
| 65 | 68 | hexchat_command (ph, "HELP IDENTD"); | |
| 66 | 69 | } | |
| 67 | 70 | ||
| 68 | - return HEXCHAT_EAT_HEXCHAT; | ||
| 71 | + return HEXCHAT_EAT_ALL; | ||
| 69 | 72 | } | |
| 70 | 73 | ||
| 71 | 74 | static void | |
@@ -150,7 +153,7 @@ identd_incoming_cb (GSocketService *service, GSocketConnection *conn, | |||
| 150 | 153 | return TRUE; | |
| 151 | 154 | } | |
| 152 | 155 | ||
| 153 | - static gboolean | ||
| 156 | + static void | ||
| 154 | 157 | identd_start_server (void) | |
| 155 | 158 | { | |
| 156 | 159 | GError *error = NULL; | |
@@ -159,7 +162,7 @@ identd_start_server (void) | |||
| 159 | 162 | if (hexchat_get_prefs (ph, "identd", NULL, &enabled) == 3) | |
| 160 | 163 | { | |
| 161 | 164 | if (!enabled) | |
| 162 | - return TRUE; /* Count as loaded successfully but don't start service */ | ||
| 165 | + return; | ||
| 163 | 166 | } | |
| 164 | 167 | if (hexchat_get_prefs (ph, "identd_port", NULL, &port) == 2 && (port <= 0 || port > G_MAXUINT16)) | |
| 165 | 168 | { | |
@@ -174,14 +177,13 @@ identd_start_server (void) | |||
| 174 | 177 | hexchat_printf (ph, _("*\tError starting identd server: %s"), error->message); | |
| 175 | 178 | ||
| 176 | 179 | g_object_unref (service); | |
| 177 | - return FALSE; | ||
| 180 | + service = NULL; | ||
| 181 | + return; | ||
| 178 | 182 | } | |
| 179 | 183 | /*hexchat_printf (ph, "*\tIdentd listening on port: %d", port); */ | |
| 180 | 184 | ||
| 181 | 185 | g_signal_connect (G_OBJECT (service), "incoming", G_CALLBACK(identd_incoming_cb), NULL); | |
| 182 | 186 | g_socket_service_start (service); | |
| 183 | - | ||
| 184 | - return TRUE; | ||
| 185 | 187 | } | |
| 186 | 188 | ||
| 187 | 189 | int | |
@@ -198,7 +200,9 @@ identd_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, | |||
| 198 | 200 | hexchat_hook_command (ph, "IDENTD", HEXCHAT_PRI_NORM, identd_command_cb, | |
| 199 | 201 | _("IDENTD <port> <username>"), NULL); | |
| 200 | 202 | ||
| 201 | - return identd_start_server (); | ||
| 203 | + identd_start_server (); | ||
| 204 | + | ||
| 205 | + return 1; /* This must always succeed for /identd to work */ | ||
| 202 | 206 | } | |
| 203 | 207 | ||
| 204 | 208 | int | |
| Back | FazBrowse Home | New Git URL |
0 commit comments