Mercurial > pidgin
annotate src/protocols/irc/irc.c @ 10002:8ba9a9048d73
[gaim-migrate @ 10919]
Configurable realname for IRC
committer: Tailor Script <tailor@pidgin.im>
| author | Ethan Blanton <elb@pidgin.im> |
|---|---|
| date | Fri, 10 Sep 2004 01:43:41 +0000 |
| parents | d908907d9441 |
| children | c124bef68132 |
| 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" |
| 7148 | 32 #include "notify.h" |
| 9030 | 33 #include "prpl.h" |
| 34 #include "plugin.h" | |
| 6350 | 35 #include "util.h" |
| 9943 | 36 #include "version.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); |
| 9953 | 43 static void irc_blist_emblems(GaimBuddy *b, const char **se, const char **sw, const char **nw, const char **ne); |
| 9951 | 44 static GList *irc_status_types(GaimAccount *account); |
| 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 | |
| 9553 | 126 static void irc_ison_one(struct irc_conn *irc, struct irc_buddy *ib) |
| 127 { | |
| 128 char *buf; | |
| 129 | |
| 130 ib->flag = FALSE; | |
| 131 buf = irc_format(irc, "vn", "ISON", ib->name); | |
| 132 irc_send(irc, buf); | |
| 133 g_free(buf); | |
| 134 } | |
| 135 | |
| 136 | |
| 6695 | 137 static const char *irc_blist_icon(GaimAccount *a, GaimBuddy *b) |
| 3029 | 138 { |
| 6333 | 139 return "irc"; |
|
2339
9bda60d2d2e6
[gaim-migrate @ 2352]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2331
diff
changeset
|
140 } |
|
9bda60d2d2e6
[gaim-migrate @ 2352]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2331
diff
changeset
|
141 |
| 9953 | 142 static void irc_blist_emblems(GaimBuddy *b, const char **se, const char **sw, const char **nw, const char **ne) |
| 3751 | 143 { |
| 6333 | 144 if (b->present == GAIM_BUDDY_OFFLINE) |
| 145 *se = "offline"; | |
| 2086 | 146 } |
| 147 | |
| 9944 | 148 static GList *irc_status_types(GaimAccount *account) |
| 2086 | 149 { |
| 9944 | 150 GaimStatusType *type; |
| 151 GList *types = NULL; | |
| 152 | |
| 153 type = gaim_status_type_new(GAIM_STATUS_OFFLINE, "offline", | |
| 154 _("Offline"), FALSE); | |
| 155 types = g_list_append(types, type); | |
| 156 | |
| 157 type = gaim_status_type_new(GAIM_STATUS_ONLINE, "online", | |
| 158 _("Online"), FALSE); | |
| 159 types = g_list_append(types, type); | |
| 160 | |
| 161 type = gaim_status_type_new(GAIM_STATUS_AVAILABLE, "available", | |
| 162 _("Available"), TRUE); | |
| 163 types = g_list_append(types, type); | |
| 164 | |
| 165 type = gaim_status_type_new_with_attrs( | |
| 166 GAIM_STATUS_AWAY, "away", _("Away"), TRUE, TRUE, FALSE, | |
| 167 "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING)); | |
| 168 | |
| 169 types = g_list_append(types, type); | |
| 170 | |
| 171 return types; | |
| 3452 | 172 } |
| 173 | |
| 9015 | 174 static GList *irc_actions(GaimPlugin *plugin, gpointer context) |
| 7148 | 175 { |
| 176 GList *list = NULL; | |
| 9015 | 177 GaimPluginAction *act = NULL; |
| 7148 | 178 |
| 9015 | 179 act = gaim_plugin_action_new(_("View MOTD"), irc_view_motd); |
| 180 list = g_list_append(list, act); | |
| 7148 | 181 |
| 182 return list; | |
| 183 } | |
| 184 | |
| 9466 | 185 #if 0 |
| 9030 | 186 static GList *irc_blist_node_menu(GaimBlistNode *node) |
| 2086 | 187 { |
| 8351 | 188 GList *m = NULL; |
| 9030 | 189 GaimBlistNodeAction *act; |
| 190 | |
| 8351 | 191 return m; |
| 2086 | 192 } |
| 9466 | 193 #endif |
| 2086 | 194 |
| 6333 | 195 static GList *irc_chat_join_info(GaimConnection *gc) |
| 2086 | 196 { |
|
2170
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
197 GList *m = NULL; |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
198 struct proto_chat_entry *pce; |
|
2170
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
199 |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
200 pce = g_new0(struct proto_chat_entry, 1); |
| 7841 | 201 pce->label = _("_Channel:"); |
| 5234 | 202 pce->identifier = "channel"; |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
203 m = g_list_append(m, pce); |
|
2170
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
204 |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
205 pce = g_new0(struct proto_chat_entry, 1); |
| 7841 | 206 pce->label = _("_Password:"); |
| 5234 | 207 pce->identifier = "password"; |
| 6499 | 208 pce->secret = TRUE; |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
209 m = g_list_append(m, pce); |
|
2170
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
210 |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
211 return m; |
| 2086 | 212 } |
| 213 | |
| 9754 | 214 GHashTable *irc_chat_info_defaults(GaimConnection *gc, const char *chat_name) |
| 215 { | |
| 216 GHashTable *defaults; | |
| 217 | |
| 218 defaults = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); | |
| 219 | |
| 220 if (chat_name != NULL) | |
| 221 g_hash_table_insert(defaults, "channel", g_strdup(chat_name)); | |
| 222 | |
| 223 return defaults; | |
| 224 } | |
| 225 | |
| 6333 | 226 static void irc_login(GaimAccount *account) |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
227 { |
| 6333 | 228 GaimConnection *gc; |
| 229 struct irc_conn *irc; | |
| 230 char *buf, **userparts; | |
| 231 const char *username = gaim_account_get_username(account); | |
| 232 int err; | |
| 233 | |
| 234 gc = gaim_account_get_connection(account); | |
| 8677 | 235 gc->flags |= GAIM_CONNECTION_NO_NEWLINES; |
| 6333 | 236 |
| 6752 | 237 if (strpbrk(username, " \t\v\r\n") != NULL) { |
| 238 gaim_connection_error(gc, _("IRC nicks may not contain whitespace")); | |
| 239 return; | |
| 240 } | |
| 241 | |
| 6333 | 242 gc->proto_data = irc = g_new0(struct irc_conn, 1); |
| 243 irc->account = account; | |
| 244 | |
| 245 userparts = g_strsplit(username, "@", 2); | |
| 246 gaim_connection_set_display_name(gc, userparts[0]); | |
| 247 irc->server = g_strdup(userparts[1]); | |
| 248 g_strfreev(userparts); | |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
249 |
| 6333 | 250 irc->buddies = g_hash_table_new_full((GHashFunc)irc_nick_hash, (GEqualFunc)irc_nick_equal, |
| 251 NULL, (GDestroyNotify)irc_buddy_free); | |
| 252 irc->cmds = g_hash_table_new(g_str_hash, g_str_equal); | |
| 253 irc_cmd_table_build(irc); | |
| 254 irc->msgs = g_hash_table_new(g_str_hash, g_str_equal); | |
| 255 irc_msg_table_build(irc); | |
| 256 | |
| 257 buf = g_strdup_printf(_("Signon: %s"), username); | |
| 258 gaim_connection_update_progress(gc, buf, 1, 2); | |
| 259 g_free(buf); | |
| 260 | |
| 261 err = gaim_proxy_connect(account, irc->server, | |
| 262 gaim_account_get_int(account, "port", IRC_DEFAULT_PORT), | |
| 263 irc_login_cb, gc); | |
| 264 | |
| 265 if (err || !account->gc) { | |
| 266 gaim_connection_error(gc, _("Couldn't create socket")); | |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
267 return; |
| 6333 | 268 } |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
269 } |
|
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
270 |
| 6333 | 271 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
|
272 { |
| 6333 | 273 GaimConnection *gc = data; |
| 274 struct irc_conn *irc = gc->proto_data; | |
| 275 char hostname[256]; | |
| 276 char *buf; | |
| 10002 | 277 const char *username, *realname; |
| 6333 | 278 GList *connections = gaim_connections_get_all(); |
| 279 | |
| 8778 | 280 if (source < 0) { |
| 281 gaim_connection_error(gc, _("Couldn't connect to host")); | |
| 6333 | 282 return; |
| 8778 | 283 } |
| 6333 | 284 |
| 285 if (!g_list_find(connections, gc)) { | |
| 286 close(source); | |
| 287 return; | |
| 288 } | |
| 289 | |
| 290 irc->fd = source; | |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
291 |
| 6333 | 292 if (gc->account->password && *gc->account->password) { |
| 293 buf = irc_format(irc, "vv", "PASS", gc->account->password); | |
| 294 if (irc_send(irc, buf) < 0) { | |
| 295 gaim_connection_error(gc, "Error sending password"); | |
| 296 return; | |
| 297 } | |
| 298 g_free(buf); | |
| 299 } | |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
300 |
| 6333 | 301 gethostname(hostname, sizeof(hostname)); |
| 302 hostname[sizeof(hostname) - 1] = '\0'; | |
| 7323 | 303 username = gaim_account_get_string(irc->account, "username", ""); |
| 10002 | 304 realname = gaim_account_get_string(irc->account, "realname", ""); |
| 7323 | 305 buf = irc_format(irc, "vvvv:", "USER", strlen(username) ? username : g_get_user_name(), hostname, irc->server, |
| 10002 | 306 strlen(realname) ? realname : IRC_DEFAULT_ALIAS); |
| 6333 | 307 if (irc_send(irc, buf) < 0) { |
| 308 gaim_connection_error(gc, "Error registering with server"); | |
| 309 return; | |
| 310 } | |
| 311 g_free(buf); | |
| 312 buf = irc_format(irc, "vn", "NICK", gaim_connection_get_display_name(gc)); | |
| 313 if (irc_send(irc, buf) < 0) { | |
| 314 gaim_connection_error(gc, "Error sending nickname"); | |
| 315 return; | |
| 316 } | |
| 317 g_free(buf); | |
| 318 | |
| 319 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
|
320 } |
|
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
321 |
| 6333 | 322 static void irc_close(GaimConnection *gc) |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
323 { |
| 6333 | 324 struct irc_conn *irc = gc->proto_data; |
| 325 | |
| 6752 | 326 if (irc == NULL) |
| 327 return; | |
| 328 | |
| 6333 | 329 irc_cmd_quit(irc, "quit", NULL, NULL); |
| 330 | |
| 331 if (gc->inpa) | |
| 9441 | 332 gaim_input_remove(gc->inpa); |
| 6333 | 333 |
| 334 g_free(irc->inbuf); | |
| 335 close(irc->fd); | |
| 336 if (irc->timer) | |
|
8287
ef881489396e
[gaim-migrate @ 9011]
Christian Hammond <chipx86@chipx86.com>
parents:
8170
diff
changeset
|
337 gaim_timeout_remove(irc->timer); |
| 6333 | 338 g_hash_table_destroy(irc->cmds); |
| 339 g_hash_table_destroy(irc->msgs); | |
| 340 if (irc->motd) | |
| 341 g_string_free(irc->motd, TRUE); | |
| 342 g_free(irc->server); | |
| 343 g_free(irc); | |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
344 } |
|
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
345 |
|
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
346 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
|
347 { |
| 6333 | 348 struct irc_conn *irc = gc->proto_data; |
| 349 const char *args[2]; | |
| 350 | |
| 7711 | 351 if (strchr(status_chars, *who) != NULL) |
| 6333 | 352 args[0] = who + 1; |
| 353 else | |
| 354 args[0] = who; | |
| 355 args[1] = what; | |
| 9442 | 356 |
| 6333 | 357 irc_cmd_privmsg(irc, "msg", NULL, args); |
| 358 return 1; | |
|
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2273
diff
changeset
|
359 } |
| 2086 | 360 |
| 6333 | 361 static void irc_get_info(GaimConnection *gc, const char *who) |
| 2086 | 362 { |
| 6333 | 363 struct irc_conn *irc = gc->proto_data; |
| 364 const char *args[1]; | |
| 365 args[0] = who; | |
| 366 irc_cmd_whois(irc, "whois", NULL, args); | |
| 367 } | |
| 368 | |
| 9944 | 369 static void irc_set_status(GaimAccount *account, GaimStatus *status) |
| 6333 | 370 { |
| 9944 | 371 GaimConnection *gc = gaim_account_get_connection(account); |
| 6333 | 372 struct irc_conn *irc = gc->proto_data; |
| 373 const char *args[1]; | |
| 9944 | 374 const char *status_id = gaim_status_get_id(status); |
| 2086 | 375 |
| 9944 | 376 if (!strcmp(status_id, "away")) |
| 377 args[0] = gaim_status_get_attr_string(status, "message"); | |
| 378 else if (!strcmp(status_id, "available")) | |
| 379 args[0] = NULL; | |
|
2393
a7ecfd3f7714
[gaim-migrate @ 2406]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2382
diff
changeset
|
380 |
| 6333 | 381 irc_cmd_away(irc, "away", NULL, args); |
| 4916 | 382 } |
| 383 | |
| 9285 | 384 static void irc_add_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group) |
| 3029 | 385 { |
| 6333 | 386 struct irc_conn *irc = (struct irc_conn *)gc->proto_data; |
| 387 struct irc_buddy *ib = g_new0(struct irc_buddy, 1); | |
| 9285 | 388 ib->name = g_strdup(buddy->name); |
| 6333 | 389 g_hash_table_insert(irc->buddies, ib->name, ib); |
| 9238 | 390 |
| 9553 | 391 /* if the timer isn't set, this is during signon, so we don't want to flood |
| 392 * ourself off with ISON's, so we don't, but after that we want to know when | |
| 393 * someone's online asap */ | |
| 394 if (irc->timer) | |
| 395 irc_ison_one(irc, ib); | |
| 3029 | 396 } |
| 3622 | 397 |
| 9285 | 398 static void irc_remove_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group) |
| 6333 | 399 { |
| 400 struct irc_conn *irc = (struct irc_conn *)gc->proto_data; | |
| 9285 | 401 g_hash_table_remove(irc->buddies, buddy->name); |
| 3616 | 402 } |
|
4514
7521e29658bc
[gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
4509
diff
changeset
|
403 |
| 6333 | 404 static void irc_input_cb(gpointer data, gint source, GaimInputCondition cond) |
| 405 { | |
| 406 GaimConnection *gc = data; | |
| 407 struct irc_conn *irc = gc->proto_data; | |
| 408 char *cur, *end; | |
| 409 int len; | |
| 410 | |
| 411 if (irc->inbuflen < irc->inbufused + IRC_INITIAL_BUFSIZE) { | |
| 412 irc->inbuflen += IRC_INITIAL_BUFSIZE; | |
| 413 irc->inbuf = g_realloc(irc->inbuf, irc->inbuflen); | |
| 3708 | 414 } |
| 3616 | 415 |
| 6333 | 416 if ((len = read(irc->fd, irc->inbuf + irc->inbufused, IRC_INITIAL_BUFSIZE - 1)) < 0) { |
| 7653 | 417 gaim_connection_error(gc, _("Read error")); |
| 6333 | 418 return; |
| 6369 | 419 } else if (len == 0) { |
| 9440 | 420 gaim_connection_error(gc, _("Server has disconnected")); |
| 6369 | 421 return; |
| 6333 | 422 } |
| 6369 | 423 |
| 6333 | 424 irc->inbufused += len; |
| 425 irc->inbuf[irc->inbufused] = '\0'; | |
| 3616 | 426 |
| 8156 | 427 cur = irc->inbuf; |
| 428 while (cur < irc->inbuf + irc->inbufused && | |
| 429 ((end = strstr(cur, "\r\n")) || (end = strstr(cur, "\n")))) { | |
| 430 int step = (*end == '\r' ? 2 : 1); | |
| 6333 | 431 *end = '\0'; |
| 432 irc_parse_msg(irc, cur); | |
| 8156 | 433 cur = end + step; |
| 6333 | 434 } |
| 435 if (cur != irc->inbuf + irc->inbufused) { /* leftover */ | |
| 436 irc->inbufused -= (cur - irc->inbuf); | |
| 437 memmove(irc->inbuf, cur, irc->inbufused); | |
| 438 } else { | |
| 439 irc->inbufused = 0; | |
| 440 } | |
| 3616 | 441 } |
| 442 | |
| 6333 | 443 static void irc_chat_join (GaimConnection *gc, GHashTable *data) |
| 444 { | |
| 445 struct irc_conn *irc = gc->proto_data; | |
| 446 const char *args[2]; | |
| 3616 | 447 |
| 6333 | 448 args[0] = g_hash_table_lookup(data, "channel"); |
| 449 args[1] = g_hash_table_lookup(data, "password"); | |
| 450 irc_cmd_join(irc, "join", NULL, args); | |
| 3622 | 451 } |
| 452 | |
| 9917 | 453 static char *irc_get_chat_name(GHashTable *data) { |
| 454 return g_strdup(g_hash_table_lookup(data, "channel")); | |
| 455 } | |
| 456 | |
| 6333 | 457 static void irc_chat_invite(GaimConnection *gc, int id, const char *message, const char *name) |
| 3751 | 458 { |
| 6333 | 459 struct irc_conn *irc = gc->proto_data; |
| 460 GaimConversation *convo = gaim_find_chat(gc, id); | |
| 461 const char *args[2]; | |
| 3751 | 462 |
| 6333 | 463 if (!convo) { |
| 464 gaim_debug(GAIM_DEBUG_ERROR, "irc", "Got chat invite request for bogus chat\n"); | |
| 465 return; | |
| 466 } | |
| 467 args[0] = name; | |
| 468 args[1] = gaim_conversation_get_name(convo); | |
| 469 irc_cmd_invite(irc, "invite", gaim_conversation_get_name(convo), args); | |
| 3707 | 470 } |
| 471 | |
| 6333 | 472 |
| 473 static void irc_chat_leave (GaimConnection *gc, int id) | |
| 3707 | 474 { |
| 6333 | 475 struct irc_conn *irc = gc->proto_data; |
| 476 GaimConversation *convo = gaim_find_chat(gc, id); | |
| 477 const char *args[2]; | |
| 5298 | 478 |
| 6333 | 479 if (!convo) |
| 480 return; | |
| 3735 | 481 |
| 6333 | 482 args[0] = gaim_conversation_get_name(convo); |
| 483 args[1] = NULL; | |
| 484 irc_cmd_part(irc, "part", gaim_conversation_get_name(convo), args); | |
| 485 serv_got_chat_left(gc, id); | |
| 3735 | 486 } |
| 487 | |
| 6333 | 488 static int irc_chat_send(GaimConnection *gc, int id, const char *what) |
| 3735 | 489 { |
| 6333 | 490 struct irc_conn *irc = gc->proto_data; |
| 491 GaimConversation *convo = gaim_find_chat(gc, id); | |
| 492 const char *args[2]; | |
| 8163 | 493 char *tmp; |
| 6333 | 494 |
| 495 if (!convo) { | |
| 496 gaim_debug(GAIM_DEBUG_ERROR, "irc", "chat send on nonexistent chat\n"); | |
| 497 return -EINVAL; | |
| 498 } | |
| 9130 | 499 #if 0 |
| 6333 | 500 if (*what == '/') { |
| 501 return irc_parse_cmd(irc, convo->name, what + 1); | |
| 502 } | |
| 9130 | 503 #endif |
| 6333 | 504 args[0] = convo->name; |
| 505 args[1] = what; | |
| 506 | |
| 507 irc_cmd_privmsg(irc, "msg", NULL, args); | |
| 8163 | 508 |
| 509 tmp = gaim_escape_html(what); | |
| 510 serv_got_chat_in(gc, id, gaim_connection_get_display_name(gc), 0, tmp, time(NULL)); | |
| 511 g_free(tmp); | |
| 6333 | 512 return 0; |
| 3707 | 513 } |
| 514 | |
| 6333 | 515 static guint irc_nick_hash(const char *nick) |
| 516 { | |
| 517 char *lc; | |
| 518 guint bucket; | |
|
6270
1bf6fd117797
[gaim-migrate @ 6767]
Christian Hammond <chipx86@chipx86.com>
parents:
6240
diff
changeset
|
519 |
| 6333 | 520 lc = g_utf8_strdown(nick, -1); |
| 521 bucket = g_str_hash(lc); | |
| 522 g_free(lc); | |
|
6270
1bf6fd117797
[gaim-migrate @ 6767]
Christian Hammond <chipx86@chipx86.com>
parents:
6240
diff
changeset
|
523 |
| 6333 | 524 return bucket; |
| 3029 | 525 } |
| 526 | |
| 6333 | 527 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
|
528 { |
| 6333 | 529 return (gaim_utf8_strcasecmp(nick1, nick2) == 0); |
|
2619
536198196dc6
[gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2617
diff
changeset
|
530 } |
|
536198196dc6
[gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2617
diff
changeset
|
531 |
| 6333 | 532 static void irc_buddy_free(struct irc_buddy *ib) |
|
2619
536198196dc6
[gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2617
diff
changeset
|
533 { |
| 6333 | 534 g_free(ib->name); |
| 535 g_free(ib); | |
|
2619
536198196dc6
[gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2617
diff
changeset
|
536 } |
|
536198196dc6
[gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2617
diff
changeset
|
537 |
| 9154 | 538 static void irc_chat_set_topic(GaimConnection *gc, int id, const char *topic) |
| 539 { | |
| 540 char *buf; | |
| 541 const char *name = NULL; | |
| 542 struct irc_conn *irc; | |
| 543 | |
| 544 irc = gc->proto_data; | |
| 545 name = gaim_conversation_get_name(gaim_find_chat(gc, id)); | |
| 546 | |
| 547 if (name == NULL) | |
| 548 return; | |
| 549 | |
| 550 buf = irc_format(irc, "vt:", "TOPIC", name, topic); | |
| 551 irc_send(irc, buf); | |
| 552 g_free(buf); | |
| 553 } | |
| 554 | |
| 8114 | 555 static GaimRoomlist *irc_roomlist_get_list(GaimConnection *gc) |
| 556 { | |
| 557 struct irc_conn *irc; | |
| 558 GList *fields = NULL; | |
| 559 GaimRoomlistField *f; | |
| 8352 | 560 char *buf; |
| 8114 | 561 |
| 562 irc = gc->proto_data; | |
| 563 | |
| 564 if (irc->roomlist) | |
| 565 gaim_roomlist_unref(irc->roomlist); | |
| 566 | |
| 567 irc->roomlist = gaim_roomlist_new(gaim_connection_get_account(gc)); | |
| 568 | |
| 569 f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, "", "channel", TRUE); | |
| 570 fields = g_list_append(fields, f); | |
| 571 | |
| 572 f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_INT, _("Users"), "users", FALSE); | |
| 573 fields = g_list_append(fields, f); | |
| 574 | |
| 575 f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, _("Topic"), "topic", FALSE); | |
| 576 fields = g_list_append(fields, f); | |
| 577 | |
| 578 gaim_roomlist_set_fields(irc->roomlist, fields); | |
| 579 | |
| 8352 | 580 buf = irc_format(irc, "v", "LIST"); |
| 581 irc_send(irc, buf); | |
| 582 g_free(buf); | |
| 8114 | 583 |
| 584 return irc->roomlist; | |
| 585 } | |
| 586 | |
| 587 static void irc_roomlist_cancel(GaimRoomlist *list) | |
| 588 { | |
| 589 GaimConnection *gc = gaim_account_get_connection(list->account); | |
| 590 struct irc_conn *irc; | |
| 591 | |
| 592 if (gc == NULL) | |
| 593 return; | |
| 594 | |
| 595 irc = gc->proto_data; | |
| 596 | |
| 597 gaim_roomlist_set_in_progress(list, FALSE); | |
| 598 | |
| 599 if (irc->roomlist == list) { | |
| 600 irc->roomlist = NULL; | |
| 601 gaim_roomlist_unref(list); | |
| 602 } | |
| 603 } | |
| 604 | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
605 static GaimPluginProtocolInfo prpl_info = |
| 2086 | 606 { |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
607 OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL, |
| 9475 | 608 NULL, /* user_splits */ |
| 609 NULL, /* protocol_options */ | |
| 9951 | 610 NO_BUDDY_ICONS, /* icon_spec */ |
| 611 irc_blist_icon, /* list_icon */ | |
| 612 irc_blist_emblems, /* list_emblems */ | |
| 9475 | 613 NULL, /* status_text */ |
| 614 NULL, /* tooltip_text */ | |
| 9951 | 615 irc_status_types, /* away_states */ |
| 9475 | 616 NULL, /* blist_node_menu */ |
| 9951 | 617 irc_chat_join_info, /* chat_info */ |
| 9754 | 618 irc_chat_info_defaults, /* chat_info_defaults */ |
| 9951 | 619 irc_login, /* login */ |
| 620 irc_close, /* close */ | |
| 621 irc_im_send, /* send_im */ | |
| 9475 | 622 NULL, /* set_info */ |
| 623 NULL, /* send_typing */ | |
| 9951 | 624 irc_get_info, /* get_info */ |
| 625 irc_set_status, /* set_status */ | |
| 9475 | 626 NULL, /* set_idle */ |
| 627 NULL, /* change_passwd */ | |
| 9951 | 628 irc_add_buddy, /* add_buddy */ |
| 9475 | 629 NULL, /* add_buddies */ |
| 9951 | 630 irc_remove_buddy, /* remove_buddy */ |
| 9475 | 631 NULL, /* remove_buddies */ |
| 9741 | 632 NULL, /* add_permit */ |
| 633 NULL, /* add_deny */ | |
| 634 NULL, /* rem_permit */ | |
| 635 NULL, /* rem_deny */ | |
| 636 NULL, /* set_permit_deny */ | |
| 9475 | 637 NULL, /* warn */ |
| 9951 | 638 irc_chat_join, /* join_chat */ |
| 9475 | 639 NULL, /* reject_chat */ |
| 9951 | 640 irc_get_chat_name, /* get_chat_name */ |
| 641 irc_chat_invite, /* chat_invite */ | |
| 642 irc_chat_leave, /* chat_leave */ | |
| 9475 | 643 NULL, /* chat_whisper */ |
| 9951 | 644 irc_chat_send, /* chat_send */ |
| 9475 | 645 NULL, /* keepalive */ |
| 646 NULL, /* register_user */ | |
| 647 NULL, /* get_cb_info */ | |
| 648 NULL, /* get_cb_away */ | |
| 649 NULL, /* alias_buddy */ | |
| 650 NULL, /* group_buddy */ | |
| 651 NULL, /* rename_group */ | |
| 652 NULL, /* buddy_free */ | |
| 653 NULL, /* convo_closed */ | |
| 654 NULL, /* normalize */ | |
| 655 NULL, /* set_buddy_icon */ | |
| 656 NULL, /* remove_group */ | |
| 657 NULL, /* get_cb_real_name */ | |
| 9951 | 658 irc_chat_set_topic, /* set_chat_topic */ |
| 9475 | 659 NULL, /* find_blist_chat */ |
| 660 irc_roomlist_get_list, /* roomlist_get_list */ | |
| 661 irc_roomlist_cancel, /* roomlist_cancel */ | |
| 662 NULL, /* roomlist_expand_category */ | |
| 663 NULL, /* can_receive_file */ | |
| 664 irc_dccsend_send_file /* send_file */ | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
665 }; |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
666 |
| 8114 | 667 |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
668 static GaimPluginInfo info = |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
669 { |
| 9943 | 670 GAIM_PLUGIN_MAGIC, |
| 671 GAIM_MAJOR_VERSION, | |
| 672 GAIM_MINOR_VERSION, | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
673 GAIM_PLUGIN_PROTOCOL, /**< type */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
674 NULL, /**< ui_requirement */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
675 0, /**< flags */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
676 NULL, /**< dependencies */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
677 GAIM_PRIORITY_DEFAULT, /**< priority */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
678 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
679 "prpl-irc", /**< id */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
680 "IRC", /**< name */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
681 VERSION, /**< version */ |
| 6333 | 682 N_("IRC Protocol Plugin"), /** summary */ |
| 683 N_("The IRC Protocol Plugin that Sucks Less"), /** description */ | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
684 NULL, /**< author */ |
|
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6369
diff
changeset
|
685 GAIM_WEBSITE, /**< homepage */ |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
686 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
687 NULL, /**< load */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
688 NULL, /**< unload */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
689 NULL, /**< destroy */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
690 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
691 NULL, /**< ui_info */ |
| 8993 | 692 &prpl_info, /**< extra_info */ |
| 693 NULL, | |
| 9015 | 694 irc_actions |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
695 }; |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
696 |
| 6333 | 697 static void _init_plugin(GaimPlugin *plugin) |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5150
diff
changeset
|
698 { |
|
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5618
diff
changeset
|
699 GaimAccountUserSplit *split; |
|
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5618
diff
changeset
|
700 GaimAccountOption *option; |
|
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5618
diff
changeset
|
701 |
| 6333 | 702 split = gaim_account_user_split_new(_("Server"), IRC_DEFAULT_SERVER, '@'); |
|
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5618
diff
changeset
|
703 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
|
704 |
|
6459
b52870734c21
[gaim-migrate @ 6968]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
705 option = gaim_account_option_int_new(_("Port"), "port", IRC_DEFAULT_PORT); |
| 6333 | 706 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
|
707 |
| 6333 | 708 option = gaim_account_option_string_new(_("Encoding"), "encoding", IRC_DEFAULT_CHARSET); |
| 709 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
|
710 |
| 7323 | 711 option = gaim_account_option_string_new(_("Username"), "username", ""); |
| 712 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | |
| 713 | |
| 10002 | 714 option = gaim_account_option_string_new(_("Real name"), "realname", ""); |
| 715 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | |
| 716 | |
| 6333 | 717 _irc_plugin = plugin; |
| 9130 | 718 |
| 719 irc_register_commands(); | |
| 2086 | 720 } |
| 721 | |
| 6333 | 722 GAIM_INIT_PLUGIN(irc, _init_plugin, info); |
