Mercurial > pidgin.yaz
annotate src/protocols/irc/irc.c @ 9440:00242c2419c3
[gaim-migrate @ 10261]
This should prevent any loops on connection errors for IRC
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Fri, 02 Jul 2004 03:54:14 +0000 |
parents | b3bda982996b |
children | eaa9aa1fad61 |
rev | line source |
---|---|
6333 | 1 /** |
2 * @file irc.c | |
6459
b52870734c21
[gaim-migrate @ 6968]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
3 * |
6333 | 4 * gaim |
2086 | 5 * |
8351 | 6 * Copyright (C) 2003, Robbert Haarman <gaim@inglorion.net> |
6333 | 7 * Copyright (C) 2003, Ethan Blanton <eblanton@cs.purdue.edu> |
8 * Copyright (C) 2000-2003, Rob Flynn <rob@tgflinux.com> | |
2086 | 9 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> |
6459
b52870734c21
[gaim-migrate @ 6968]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
10 * |
2086 | 11 * This program is free software; you can redistribute it and/or modify |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
6333 | 25 |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5791
diff
changeset
|
26 #include "internal.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5791
diff
changeset
|
27 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5791
diff
changeset
|
28 #include "accountopt.h" |
9030 | 29 #include "blist.h" |
6333 | 30 #include "conversation.h" |
9030 | 31 #include "debug.h" |
32 #include "multi.h" | |
7148 | 33 #include "notify.h" |
9030 | 34 #include "prpl.h" |
35 #include "plugin.h" | |
6350 | 36 #include "util.h" |
9030 | 37 |
6333 | 38 #include "irc.h" |
4422 | 39 |
6333 | 40 static void irc_buddy_append(char *name, struct irc_buddy *ib, GString *string); |
2086 | 41 |
6695 | 42 static const char *irc_blist_icon(GaimAccount *a, GaimBuddy *b); |
43 static void irc_blist_emblems(GaimBuddy *b, char **se, char **sw, char **nw, char **ne); | |
6333 | 44 static GList *irc_away_states(GaimConnection *gc); |
9015 | 45 static GList *irc_actions(GaimPlugin *plugin, gpointer context); |
6333 | 46 /* static GList *irc_chat_info(GaimConnection *gc); */ |
47 static void irc_login(GaimAccount *account); | |
48 static void irc_login_cb(gpointer data, gint source, GaimInputCondition cond); | |
49 static void irc_close(GaimConnection *gc); | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
50 static int irc_im_send(GaimConnection *gc, const char *who, const char *what, GaimConvImFlags flags); |
6333 | 51 static int irc_chat_send(GaimConnection *gc, int id, const char *what); |
52 static void irc_chat_join (GaimConnection *gc, GHashTable *data); | |
53 static void irc_input_cb(gpointer data, gint source, GaimInputCondition cond); | |
3751 | 54 |
7711 | 55 static guint irc_nick_hash(const char *nick); |
56 static gboolean irc_nick_equal(const char *nick1, const char *nick2); | |
57 static void irc_buddy_free(struct irc_buddy *ib); | |
58 | |
59 static GaimPlugin *_irc_plugin = NULL; | |
60 | |
61 static const char *status_chars = "@+%&"; | |
62 | |
9015 | 63 static void irc_view_motd(GaimPluginAction *action) |
7148 | 64 { |
9015 | 65 GaimConnection *gc = (GaimConnection *) action->context; |
7148 | 66 struct irc_conn *irc; |
67 char *title; | |
68 | |
69 if (gc == NULL || gc->proto_data == NULL) { | |
70 gaim_debug(GAIM_DEBUG_ERROR, "irc", "got MOTD request for NULL gc\n"); | |
71 return; | |
72 } | |
73 irc = gc->proto_data; | |
74 if (irc->motd == NULL) { | |
75 gaim_notify_error(gc, _("Error displaying MOTD"), _("No MOTD available"), | |
76 _("There is no MOTD associated with this connection.")); | |
77 return; | |
78 } | |
79 title = g_strdup_printf(_("MOTD for %s"), irc->server); | |
80 gaim_notify_formatted(gc, title, title, NULL, irc->motd->str, NULL, NULL); | |
81 } | |
82 | |
6333 | 83 int irc_send(struct irc_conn *irc, const char *buf) |
3751 | 84 { |
9440 | 85 int ret; |
86 | |
6333 | 87 if (irc->fd < 0) |
88 return -1; | |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2171
diff
changeset
|
89 |
6333 | 90 /* gaim_debug(GAIM_DEBUG_MISC, "irc", "sent: %s", buf); */ |
9440 | 91 if ((ret = write(irc->fd, buf, strlen(buf))) < 0) |
92 gaim_connection_error(gaim_account_get_connection(irc->account), | |
93 _("Server has disconnected")); | |
94 | |
95 return ret; | |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2171
diff
changeset
|
96 } |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2171
diff
changeset
|
97 |
6333 | 98 /* XXX I don't like messing directly with these buddies */ |
99 gboolean irc_blist_timeout(struct irc_conn *irc) | |
2086 | 100 { |
6333 | 101 GString *string = g_string_sized_new(512); |
102 char *list, *buf; | |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
103 |
6333 | 104 g_hash_table_foreach(irc->buddies, (GHFunc)irc_buddy_append, (gpointer)string); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
105 |
6333 | 106 list = g_string_free(string, FALSE); |
107 if (!list || !strlen(list)) { | |
108 g_free(list); | |
2137
18722ae5b882
[gaim-migrate @ 2147]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2131
diff
changeset
|
109 return TRUE; |
2086 | 110 } |
4416
8e62cee6d738
[gaim-migrate @ 4689]
Christian Hammond <chipx86@chipx86.com>
parents:
4373
diff
changeset
|
111 |
8038 | 112 buf = irc_format(irc, "vn", "ISON", list); |
6333 | 113 g_free(list); |
114 irc_send(irc, buf); | |
115 g_free(buf); | |
4416
8e62cee6d738
[gaim-migrate @ 4689]
Christian Hammond <chipx86@chipx86.com>
parents:
4373
diff
changeset
|
116 |
2131
acc11216ec5d
[gaim-migrate @ 2141]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2123
diff
changeset
|
117 return TRUE; |
2086 | 118 } |
119 | |
6333 | 120 static void irc_buddy_append(char *name, struct irc_buddy *ib, GString *string) |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
121 { |
6333 | 122 ib->flag = FALSE; |
123 g_string_append_printf(string, "%s ", name); | |
3511 | 124 } |
125 | |
6695 | 126 static const char *irc_blist_icon(GaimAccount *a, GaimBuddy *b) |
3029 | 127 { |
6333 | 128 return "irc"; |
2339
9bda60d2d2e6
[gaim-migrate @ 2352]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2331
diff
changeset
|
129 } |
9bda60d2d2e6
[gaim-migrate @ 2352]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2331
diff
changeset
|
130 |
6695 | 131 static void irc_blist_emblems(GaimBuddy *b, char **se, char **sw, char **nw, char **ne) |
3751 | 132 { |
6333 | 133 if (b->present == GAIM_BUDDY_OFFLINE) |
134 *se = "offline"; | |
2086 | 135 } |
136 | |
6333 | 137 static GList *irc_away_states(GaimConnection *gc) |
2086 | 138 { |
6333 | 139 return g_list_append(NULL, (gpointer)GAIM_AWAY_CUSTOM); |
3452 | 140 } |
141 | |
9015 | 142 static GList *irc_actions(GaimPlugin *plugin, gpointer context) |
7148 | 143 { |
144 GList *list = NULL; | |
9015 | 145 GaimPluginAction *act = NULL; |
7148 | 146 |
9015 | 147 act = gaim_plugin_action_new(_("View MOTD"), irc_view_motd); |
148 list = g_list_append(list, act); | |
7148 | 149 |
150 return list; | |
151 } | |
152 | |
9030 | 153 |
154 static void irc_dccsend_send_ask_menu(GaimBlistNode *node, gpointer data) | |
155 { | |
156 GaimBuddy *buddy; | |
157 GaimConnection *gc; | |
158 | |
159 g_return_if_fail(GAIM_BLIST_NODE_IS_BUDDY(node)); | |
160 | |
161 buddy = (GaimBuddy *) node; | |
162 gc =gaim_account_get_connection(buddy->account); | |
163 | |
164 irc_dccsend_send_ask(gc, buddy->name); | |
165 } | |
166 | |
167 | |
168 static GList *irc_blist_node_menu(GaimBlistNode *node) | |
2086 | 169 { |
8351 | 170 GList *m = NULL; |
9030 | 171 GaimBlistNodeAction *act; |
172 | |
173 if(GAIM_BLIST_NODE_IS_BUDDY(node)) { | |
174 act = gaim_blist_node_action_new(_("Send File"), | |
175 irc_dccsend_send_ask_menu, NULL); | |
176 m = g_list_append(m, act); | |
177 } | |
8351 | 178 |
179 return m; | |
2086 | 180 } |
181 | |
6333 | 182 static GList *irc_chat_join_info(GaimConnection *gc) |
2086 | 183 { |
2170
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
184 GList *m = NULL; |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
185 struct proto_chat_entry *pce; |
2170
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
186 |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
187 pce = g_new0(struct proto_chat_entry, 1); |
7841 | 188 pce->label = _("_Channel:"); |
5234 | 189 pce->identifier = "channel"; |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
190 m = g_list_append(m, pce); |
2170
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
191 |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
192 pce = g_new0(struct proto_chat_entry, 1); |
7841 | 193 pce->label = _("_Password:"); |
5234 | 194 pce->identifier = "password"; |
6499 | 195 pce->secret = TRUE; |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
196 m = g_list_append(m, pce); |
2170
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
197 |
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
198 return m; |
2086 | 199 } |
200 | |
6333 | 201 static void irc_login(GaimAccount *account) |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
202 { |
6333 | 203 GaimConnection *gc; |
204 struct irc_conn *irc; | |
205 char *buf, **userparts; | |
206 const char *username = gaim_account_get_username(account); | |
207 int err; | |
208 | |
209 gc = gaim_account_get_connection(account); | |
8677 | 210 gc->flags |= GAIM_CONNECTION_NO_NEWLINES; |
6333 | 211 |
6752 | 212 if (strpbrk(username, " \t\v\r\n") != NULL) { |
213 gaim_connection_error(gc, _("IRC nicks may not contain whitespace")); | |
214 return; | |
215 } | |
216 | |
6333 | 217 gc->proto_data = irc = g_new0(struct irc_conn, 1); |
218 irc->account = account; | |
219 | |
220 userparts = g_strsplit(username, "@", 2); | |
221 gaim_connection_set_display_name(gc, userparts[0]); | |
222 irc->server = g_strdup(userparts[1]); | |
223 g_strfreev(userparts); | |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
224 |
6333 | 225 irc->buddies = g_hash_table_new_full((GHashFunc)irc_nick_hash, (GEqualFunc)irc_nick_equal, |
226 NULL, (GDestroyNotify)irc_buddy_free); | |
227 irc->cmds = g_hash_table_new(g_str_hash, g_str_equal); | |
228 irc_cmd_table_build(irc); | |
229 irc->msgs = g_hash_table_new(g_str_hash, g_str_equal); | |
230 irc_msg_table_build(irc); | |
231 | |
232 buf = g_strdup_printf(_("Signon: %s"), username); | |
233 gaim_connection_update_progress(gc, buf, 1, 2); | |
234 g_free(buf); | |
235 | |
236 err = gaim_proxy_connect(account, irc->server, | |
237 gaim_account_get_int(account, "port", IRC_DEFAULT_PORT), | |
238 irc_login_cb, gc); | |
239 | |
240 if (err || !account->gc) { | |
241 gaim_connection_error(gc, _("Couldn't create socket")); | |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
242 return; |
6333 | 243 } |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
244 } |
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
245 |
6333 | 246 static void irc_login_cb(gpointer data, gint source, GaimInputCondition cond) |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
247 { |
6333 | 248 GaimConnection *gc = data; |
249 struct irc_conn *irc = gc->proto_data; | |
250 char hostname[256]; | |
251 char *buf; | |
7323 | 252 const char *username; |
6333 | 253 GList *connections = gaim_connections_get_all(); |
254 | |
8778 | 255 if (source < 0) { |
256 gaim_connection_error(gc, _("Couldn't connect to host")); | |
6333 | 257 return; |
8778 | 258 } |
6333 | 259 |
260 if (!g_list_find(connections, gc)) { | |
261 close(source); | |
262 return; | |
263 } | |
264 | |
265 irc->fd = source; | |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
266 |
6333 | 267 if (gc->account->password && *gc->account->password) { |
268 buf = irc_format(irc, "vv", "PASS", gc->account->password); | |
269 if (irc_send(irc, buf) < 0) { | |
270 gaim_connection_error(gc, "Error sending password"); | |
271 return; | |
272 } | |
273 g_free(buf); | |
274 } | |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
275 |
6333 | 276 gethostname(hostname, sizeof(hostname)); |
277 hostname[sizeof(hostname) - 1] = '\0'; | |
7323 | 278 username = gaim_account_get_string(irc->account, "username", ""); |
279 buf = irc_format(irc, "vvvv:", "USER", strlen(username) ? username : g_get_user_name(), hostname, irc->server, | |
6333 | 280 gc->account->alias && *gc->account->alias ? gc->account->alias : IRC_DEFAULT_ALIAS); |
281 if (irc_send(irc, buf) < 0) { | |
282 gaim_connection_error(gc, "Error registering with server"); | |
283 return; | |
284 } | |
285 g_free(buf); | |
286 buf = irc_format(irc, "vn", "NICK", gaim_connection_get_display_name(gc)); | |
287 if (irc_send(irc, buf) < 0) { | |
288 gaim_connection_error(gc, "Error sending nickname"); | |
289 return; | |
290 } | |
291 g_free(buf); | |
292 | |
293 gc->inpa = gaim_input_add(irc->fd, GAIM_INPUT_READ, irc_input_cb, gc); | |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
294 } |
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
295 |
6333 | 296 static void irc_close(GaimConnection *gc) |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
297 { |
6333 | 298 struct irc_conn *irc = gc->proto_data; |
299 | |
6752 | 300 if (irc == NULL) |
301 return; | |
302 | |
6333 | 303 irc_cmd_quit(irc, "quit", NULL, NULL); |
304 | |
305 if (gc->inpa) | |
8287
ef881489396e
[gaim-migrate @ 9011]
Christian Hammond <chipx86@chipx86.com>
parents:
8170
diff
changeset
|
306 gaim_timeout_remove(gc->inpa); |
6333 | 307 |
308 g_free(irc->inbuf); | |
309 close(irc->fd); | |
310 if (irc->timer) | |
8287
ef881489396e
[gaim-migrate @ 9011]
Christian Hammond <chipx86@chipx86.com>
parents:
8170
diff
changeset
|
311 gaim_timeout_remove(irc->timer); |
6333 | 312 g_hash_table_destroy(irc->cmds); |
313 g_hash_table_destroy(irc->msgs); | |
314 if (irc->motd) | |
315 g_string_free(irc->motd, TRUE); | |
316 g_free(irc->server); | |
317 g_free(irc); | |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
318 } |
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
319 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
320 static int irc_im_send(GaimConnection *gc, const char *who, const char *what, GaimConvImFlags flags) |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
321 { |
6333 | 322 struct irc_conn *irc = gc->proto_data; |
323 const char *args[2]; | |
324 | |
7711 | 325 if (strchr(status_chars, *who) != NULL) |
6333 | 326 args[0] = who + 1; |
327 else | |
328 args[0] = who; | |
329 args[1] = what; | |
9130 | 330 #if 0 |
6333 | 331 if (*what == '/') { |
332 return irc_parse_cmd(irc, who, what + 1); | |
333 } | |
9130 | 334 #endif |
6333 | 335 irc_cmd_privmsg(irc, "msg", NULL, args); |
336 return 1; | |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
337 } |
2086 | 338 |
6333 | 339 static void irc_get_info(GaimConnection *gc, const char *who) |
2086 | 340 { |
6333 | 341 struct irc_conn *irc = gc->proto_data; |
342 const char *args[1]; | |
343 args[0] = who; | |
344 irc_cmd_whois(irc, "whois", NULL, args); | |
345 } | |
346 | |
347 static void irc_set_away(GaimConnection *gc, const char *state, const char *msg) | |
348 { | |
349 struct irc_conn *irc = gc->proto_data; | |
350 const char *args[1]; | |
2086 | 351 |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4067
diff
changeset
|
352 if (gc->away) { |
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4067
diff
changeset
|
353 g_free(gc->away); |
2394
579f8d4347ad
[gaim-migrate @ 2407]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2393
diff
changeset
|
354 gc->away = NULL; |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4067
diff
changeset
|
355 } |
2393
a7ecfd3f7714
[gaim-migrate @ 2406]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2382
diff
changeset
|
356 |
6333 | 357 if (msg) |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4067
diff
changeset
|
358 gc->away = g_strdup(msg); |
2086 | 359 |
6333 | 360 args[0] = msg; |
361 irc_cmd_away(irc, "away", NULL, args); | |
4916 | 362 } |
363 | |
9285 | 364 static void irc_add_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group) |
3029 | 365 { |
6333 | 366 struct irc_conn *irc = (struct irc_conn *)gc->proto_data; |
367 struct irc_buddy *ib = g_new0(struct irc_buddy, 1); | |
9285 | 368 ib->name = g_strdup(buddy->name); |
6333 | 369 g_hash_table_insert(irc->buddies, ib->name, ib); |
9238 | 370 |
371 irc_blist_timeout(irc); | |
3029 | 372 } |
3622 | 373 |
9285 | 374 static void irc_remove_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group) |
6333 | 375 { |
376 struct irc_conn *irc = (struct irc_conn *)gc->proto_data; | |
9285 | 377 g_hash_table_remove(irc->buddies, buddy->name); |
3616 | 378 } |
4514
7521e29658bc
[gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
4509
diff
changeset
|
379 |
6333 | 380 static void irc_input_cb(gpointer data, gint source, GaimInputCondition cond) |
381 { | |
382 GaimConnection *gc = data; | |
383 struct irc_conn *irc = gc->proto_data; | |
384 char *cur, *end; | |
385 int len; | |
386 | |
387 if (irc->inbuflen < irc->inbufused + IRC_INITIAL_BUFSIZE) { | |
388 irc->inbuflen += IRC_INITIAL_BUFSIZE; | |
389 irc->inbuf = g_realloc(irc->inbuf, irc->inbuflen); | |
3708 | 390 } |
3616 | 391 |
6333 | 392 if ((len = read(irc->fd, irc->inbuf + irc->inbufused, IRC_INITIAL_BUFSIZE - 1)) < 0) { |
7653 | 393 gaim_connection_error(gc, _("Read error")); |
6333 | 394 return; |
6369 | 395 } else if (len == 0) { |
9440 | 396 gaim_connection_error(gc, _("Server has disconnected")); |
6369 | 397 return; |
6333 | 398 } |
6369 | 399 |
6333 | 400 irc->inbufused += len; |
401 irc->inbuf[irc->inbufused] = '\0'; | |
3616 | 402 |
8156 | 403 cur = irc->inbuf; |
404 while (cur < irc->inbuf + irc->inbufused && | |
405 ((end = strstr(cur, "\r\n")) || (end = strstr(cur, "\n")))) { | |
406 int step = (*end == '\r' ? 2 : 1); | |
6333 | 407 *end = '\0'; |
408 irc_parse_msg(irc, cur); | |
8156 | 409 cur = end + step; |
6333 | 410 } |
411 if (cur != irc->inbuf + irc->inbufused) { /* leftover */ | |
412 irc->inbufused -= (cur - irc->inbuf); | |
413 memmove(irc->inbuf, cur, irc->inbufused); | |
414 } else { | |
415 irc->inbufused = 0; | |
416 } | |
3616 | 417 } |
418 | |
6333 | 419 static void irc_chat_join (GaimConnection *gc, GHashTable *data) |
420 { | |
421 struct irc_conn *irc = gc->proto_data; | |
422 const char *args[2]; | |
3616 | 423 |
6333 | 424 args[0] = g_hash_table_lookup(data, "channel"); |
425 args[1] = g_hash_table_lookup(data, "password"); | |
426 irc_cmd_join(irc, "join", NULL, args); | |
3622 | 427 } |
428 | |
6333 | 429 static void irc_chat_invite(GaimConnection *gc, int id, const char *message, const char *name) |
3751 | 430 { |
6333 | 431 struct irc_conn *irc = gc->proto_data; |
432 GaimConversation *convo = gaim_find_chat(gc, id); | |
433 const char *args[2]; | |
3751 | 434 |
6333 | 435 if (!convo) { |
436 gaim_debug(GAIM_DEBUG_ERROR, "irc", "Got chat invite request for bogus chat\n"); | |
437 return; | |
438 } | |
439 args[0] = name; | |
440 args[1] = gaim_conversation_get_name(convo); | |
441 irc_cmd_invite(irc, "invite", gaim_conversation_get_name(convo), args); | |
3707 | 442 } |
443 | |
6333 | 444 |
445 static void irc_chat_leave (GaimConnection *gc, int id) | |
3707 | 446 { |
6333 | 447 struct irc_conn *irc = gc->proto_data; |
448 GaimConversation *convo = gaim_find_chat(gc, id); | |
449 const char *args[2]; | |
5298 | 450 |
6333 | 451 if (!convo) |
452 return; | |
3735 | 453 |
6333 | 454 args[0] = gaim_conversation_get_name(convo); |
455 args[1] = NULL; | |
456 irc_cmd_part(irc, "part", gaim_conversation_get_name(convo), args); | |
457 serv_got_chat_left(gc, id); | |
3735 | 458 } |
459 | |
6333 | 460 static int irc_chat_send(GaimConnection *gc, int id, const char *what) |
3735 | 461 { |
6333 | 462 struct irc_conn *irc = gc->proto_data; |
463 GaimConversation *convo = gaim_find_chat(gc, id); | |
464 const char *args[2]; | |
8163 | 465 char *tmp; |
6333 | 466 |
467 if (!convo) { | |
468 gaim_debug(GAIM_DEBUG_ERROR, "irc", "chat send on nonexistent chat\n"); | |
469 return -EINVAL; | |
470 } | |
9130 | 471 #if 0 |
6333 | 472 if (*what == '/') { |
473 return irc_parse_cmd(irc, convo->name, what + 1); | |
474 } | |
9130 | 475 #endif |
6333 | 476 args[0] = convo->name; |
477 args[1] = what; | |
478 | |
479 irc_cmd_privmsg(irc, "msg", NULL, args); | |
8163 | 480 |
481 tmp = gaim_escape_html(what); | |
482 serv_got_chat_in(gc, id, gaim_connection_get_display_name(gc), 0, tmp, time(NULL)); | |
483 g_free(tmp); | |
6333 | 484 return 0; |
3707 | 485 } |
486 | |
6333 | 487 static guint irc_nick_hash(const char *nick) |
488 { | |
489 char *lc; | |
490 guint bucket; | |
6270
1bf6fd117797
[gaim-migrate @ 6767]
Christian Hammond <chipx86@chipx86.com>
parents:
6240
diff
changeset
|
491 |
6333 | 492 lc = g_utf8_strdown(nick, -1); |
493 bucket = g_str_hash(lc); | |
494 g_free(lc); | |
6270
1bf6fd117797
[gaim-migrate @ 6767]
Christian Hammond <chipx86@chipx86.com>
parents:
6240
diff
changeset
|
495 |
6333 | 496 return bucket; |
3029 | 497 } |
498 | |
6333 | 499 static gboolean irc_nick_equal(const char *nick1, const char *nick2) |
2619
536198196dc6
[gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2617
diff
changeset
|
500 { |
6333 | 501 return (gaim_utf8_strcasecmp(nick1, nick2) == 0); |
2619
536198196dc6
[gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2617
diff
changeset
|
502 } |
536198196dc6
[gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2617
diff
changeset
|
503 |
6333 | 504 static void irc_buddy_free(struct irc_buddy *ib) |
2619
536198196dc6
[gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2617
diff
changeset
|
505 { |
6333 | 506 g_free(ib->name); |
507 g_free(ib); | |
2619
536198196dc6
[gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2617
diff
changeset
|
508 } |
536198196dc6
[gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2617
diff
changeset
|
509 |
9154 | 510 static void irc_chat_set_topic(GaimConnection *gc, int id, const char *topic) |
511 { | |
512 char *buf; | |
513 const char *name = NULL; | |
514 struct irc_conn *irc; | |
515 | |
516 irc = gc->proto_data; | |
517 name = gaim_conversation_get_name(gaim_find_chat(gc, id)); | |
518 | |
519 if (name == NULL) | |
520 return; | |
521 | |
522 buf = irc_format(irc, "vt:", "TOPIC", name, topic); | |
523 irc_send(irc, buf); | |
524 g_free(buf); | |
525 } | |
526 | |
8114 | 527 static GaimRoomlist *irc_roomlist_get_list(GaimConnection *gc) |
528 { | |
529 struct irc_conn *irc; | |
530 GList *fields = NULL; | |
531 GaimRoomlistField *f; | |
8352 | 532 char *buf; |
8114 | 533 |
534 irc = gc->proto_data; | |
535 | |
536 if (irc->roomlist) | |
537 gaim_roomlist_unref(irc->roomlist); | |
538 | |
539 irc->roomlist = gaim_roomlist_new(gaim_connection_get_account(gc)); | |
540 | |
541 f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, "", "channel", TRUE); | |
542 fields = g_list_append(fields, f); | |
543 | |
544 f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_INT, _("Users"), "users", FALSE); | |
545 fields = g_list_append(fields, f); | |
546 | |
547 f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, _("Topic"), "topic", FALSE); | |
548 fields = g_list_append(fields, f); | |
549 | |
550 gaim_roomlist_set_fields(irc->roomlist, fields); | |
551 | |
8352 | 552 buf = irc_format(irc, "v", "LIST"); |
553 irc_send(irc, buf); | |
554 g_free(buf); | |
8114 | 555 |
556 return irc->roomlist; | |
557 } | |
558 | |
559 static void irc_roomlist_cancel(GaimRoomlist *list) | |
560 { | |
561 GaimConnection *gc = gaim_account_get_connection(list->account); | |
562 struct irc_conn *irc; | |
563 | |
564 if (gc == NULL) | |
565 return; | |
566 | |
567 irc = gc->proto_data; | |
568 | |
569 gaim_roomlist_set_in_progress(list, FALSE); | |
570 | |
571 if (irc->roomlist == list) { | |
572 irc->roomlist = NULL; | |
573 gaim_roomlist_unref(list); | |
574 } | |
575 } | |
576 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
577 static GaimPluginProtocolInfo prpl_info = |
2086 | 578 { |
8749
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8713
diff
changeset
|
579 GAIM_PRPL_API_VERSION, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
580 OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
581 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
582 NULL, |
9308 | 583 NO_BUDDY_ICONS, |
6333 | 584 irc_blist_icon, |
585 irc_blist_emblems, | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
586 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
587 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
588 irc_away_states, |
9030 | 589 irc_blist_node_menu, |
6333 | 590 irc_chat_join_info, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
591 irc_login, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
592 irc_close, |
6333 | 593 irc_im_send, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
594 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
595 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
596 irc_get_info, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
597 irc_set_away, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
598 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
599 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
600 irc_add_buddy, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
601 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
602 irc_remove_buddy, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
603 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
604 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
605 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
606 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
607 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
608 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
609 NULL, |
6333 | 610 irc_chat_join, |
8562 | 611 NULL, /* reject chat invite */ |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
612 irc_chat_invite, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
613 irc_chat_leave, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
614 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
615 irc_chat_send, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
616 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
617 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
618 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
619 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
620 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
621 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
622 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
623 NULL, |
6333 | 624 NULL, /*irc_convo_closed,*/ |
8114 | 625 NULL, /* normalize */ |
626 NULL, /* set buddy icon */ | |
627 NULL, /* remove group */ | |
628 NULL, /* get_cb_real_name */ | |
9154 | 629 irc_chat_set_topic, |
8114 | 630 NULL, |
631 irc_roomlist_get_list, | |
632 irc_roomlist_cancel, | |
8589 | 633 NULL |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
634 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
635 |
8114 | 636 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
637 static GaimPluginInfo info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
638 { |
8749
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8713
diff
changeset
|
639 GAIM_PLUGIN_API_VERSION, /**< api_version */ |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
640 GAIM_PLUGIN_PROTOCOL, /**< type */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
641 NULL, /**< ui_requirement */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
642 0, /**< flags */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
643 NULL, /**< dependencies */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
644 GAIM_PRIORITY_DEFAULT, /**< priority */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
645 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
646 "prpl-irc", /**< id */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
647 "IRC", /**< name */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
648 VERSION, /**< version */ |
6333 | 649 N_("IRC Protocol Plugin"), /** summary */ |
650 N_("The IRC Protocol Plugin that Sucks Less"), /** description */ | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
651 NULL, /**< author */ |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6369
diff
changeset
|
652 GAIM_WEBSITE, /**< homepage */ |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
653 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
654 NULL, /**< load */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
655 NULL, /**< unload */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
656 NULL, /**< destroy */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
657 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
658 NULL, /**< ui_info */ |
8993 | 659 &prpl_info, /**< extra_info */ |
660 NULL, | |
9015 | 661 irc_actions |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
662 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
663 |
6333 | 664 static void _init_plugin(GaimPlugin *plugin) |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
665 { |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5618
diff
changeset
|
666 GaimAccountUserSplit *split; |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5618
diff
changeset
|
667 GaimAccountOption *option; |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5618
diff
changeset
|
668 |
6333 | 669 split = gaim_account_user_split_new(_("Server"), IRC_DEFAULT_SERVER, '@'); |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5618
diff
changeset
|
670 prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5618
diff
changeset
|
671 |
6459
b52870734c21
[gaim-migrate @ 6968]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
672 option = gaim_account_option_int_new(_("Port"), "port", IRC_DEFAULT_PORT); |
6333 | 673 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5618
diff
changeset
|
674 |
6333 | 675 option = gaim_account_option_string_new(_("Encoding"), "encoding", IRC_DEFAULT_CHARSET); |
676 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
677 |
7323 | 678 option = gaim_account_option_string_new(_("Username"), "username", ""); |
679 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | |
680 | |
6333 | 681 _irc_plugin = plugin; |
9130 | 682 |
683 irc_register_commands(); | |
2086 | 684 } |
685 | |
6333 | 686 GAIM_INIT_PLUGIN(irc, _init_plugin, info); |