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