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