Mercurial > pidgin
comparison src/protocols/irc/irc.c @ 4249:9c7fcb211886
[gaim-migrate @ 4499]
If anyone is curious, the commit before this fixed a bug which
didn't allow you to delete AIM or ICQ people from a deny list.
They'll show up when you sign back online, and will be deleteable
now.
This is a patch from the good Mr. McQueen.
"Twofold attack:
1) Make sure all the callback functions don't throw a mental if the gc
the dialog was asking about has disappeared. Make sure the functions
still free up the data structs as necessary in this case.
2) When setting up a ask dialog, plugins (including prpls) pass in their
handle. The ask dialog struct gets kept in a slist. When unloading a
plugin or prpl, Gaim checks the handle against the list, and sends a
cancel-type message for any outstanding dialogs.
Should avoid crashes from non-modal ask dialogs lying around."
Yeah, so that's a nice lil' improvement.
I also fixed a think where SSI "authorization denied" messages
would be gibberish. That was a bug from just a few hours ago.
Whoops.
Also, since this is like a grown up version of show and tell, I
thought this was funny:
* Robot101 fixes idiocy
<KingAnt> Does that mean I'm going to be nuetered?
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Wed, 08 Jan 2003 08:18:49 +0000 |
| parents | cd84b0fd63fc |
| children | 0c68d402f59f |
comparison
equal
deleted
inserted
replaced
| 4248:ea8fb193f5a0 | 4249:9c7fcb211886 |
|---|---|
| 55 #define PDIWORDS 32 | 55 #define PDIWORDS 32 |
| 56 | 56 |
| 57 #define USEROPT_SERV 0 | 57 #define USEROPT_SERV 0 |
| 58 #define USEROPT_PORT 1 | 58 #define USEROPT_PORT 1 |
| 59 #define USEROPT_CHARSET 2 | 59 #define USEROPT_CHARSET 2 |
| 60 | |
| 61 static struct prpl *my_protocol = NULL; | |
| 60 | 62 |
| 61 /* for win32 compatability */ | 63 /* for win32 compatability */ |
| 62 G_MODULE_IMPORT GSList *connections; | 64 G_MODULE_IMPORT GSList *connections; |
| 63 | 65 |
| 64 | 66 |
| 1179 } | 1181 } |
| 1180 } | 1182 } |
| 1181 | 1183 |
| 1182 static void | 1184 static void |
| 1183 dcc_chat_init(struct dcc_chat *data) { | 1185 dcc_chat_init(struct dcc_chat *data) { |
| 1184 proxy_connect(data->ip_address, data->port, dcc_chat_callback, data); | 1186 if (g_slist_find(connections, data->gc)) { |
| 1187 proxy_connect(data->ip_address, data->port, dcc_chat_callback, data); | |
| 1188 } else { | |
| 1189 g_free(data); | |
| 1190 } | |
| 1185 } | 1191 } |
| 1186 | 1192 |
| 1187 static void | 1193 static void |
| 1188 dcc_chat_cancel(struct dcc_chat *data){ | 1194 dcc_chat_cancel(struct dcc_chat *data){ |
| 1189 if (find_dcc_chat(data->gc, data->nick)) { | 1195 if (g_slist_find(connections, data->gc) && find_dcc_chat(data->gc, data->nick)) { |
| 1190 dcc_chat_list = g_slist_remove(dcc_chat_list, data); | 1196 dcc_chat_list = g_slist_remove(dcc_chat_list, data); |
| 1191 gaim_input_remove (data->inpa); | 1197 gaim_input_remove (data->inpa); |
| 1192 close (data->fd); | 1198 close (data->fd); |
| 1193 } | 1199 } |
| 1194 g_free(data); | 1200 g_free(data); |
| 1253 g_snprintf(dccchat->ip_address, sizeof(dccchat->ip_address), chat_args[3]); | 1259 g_snprintf(dccchat->ip_address, sizeof(dccchat->ip_address), chat_args[3]); |
| 1254 printf("DCC CHAT DEBUG CRAP: %s\n", dccchat->ip_address); | 1260 printf("DCC CHAT DEBUG CRAP: %s\n", dccchat->ip_address); |
| 1255 dccchat->port=atoi(chat_args[4]); | 1261 dccchat->port=atoi(chat_args[4]); |
| 1256 g_snprintf(dccchat->nick, sizeof(dccchat->nick), nick); | 1262 g_snprintf(dccchat->nick, sizeof(dccchat->nick), nick); |
| 1257 g_snprintf(ask, sizeof(ask), _("%s would like to establish a DCC chat"), nick); | 1263 g_snprintf(ask, sizeof(ask), _("%s would like to establish a DCC chat"), nick); |
| 1258 do_ask_dialog(ask, _("This requires a direct connection to be established between the two computers. Messages sent will not pass through the IRC server"), dccchat, _("Connect"), dcc_chat_init, _("Cancel"), dcc_chat_cancel, FALSE); | 1264 do_ask_dialog(ask, _("This requires a direct connection to be established between the two computers. Messages sent will not pass through the IRC server"), dccchat, _("Connect"), dcc_chat_init, _("Cancel"), dcc_chat_cancel, my_protocol->plug ? my_protocol->plug->handle : NULL, FALSE); |
| 1259 } | 1265 } |
| 1260 | 1266 |
| 1261 | 1267 |
| 1262 if (!g_strncasecmp(msg, "DCC SEND", 8)) { | 1268 if (!g_strncasecmp(msg, "DCC SEND", 8)) { |
| 1263 struct irc_file_transfer *ift = g_new0(struct irc_file_transfer, 1); | 1269 struct irc_file_transfer *ift = g_new0(struct irc_file_transfer, 1); |
| 2656 m = g_list_append(m, pbm); | 2662 m = g_list_append(m, pbm); |
| 2657 | 2663 |
| 2658 return m; | 2664 return m; |
| 2659 } | 2665 } |
| 2660 | 2666 |
| 2661 static struct prpl *my_protocol = NULL; | |
| 2662 | |
| 2663 G_MODULE_EXPORT void | 2667 G_MODULE_EXPORT void |
| 2664 irc_init(struct prpl *ret) | 2668 irc_init(struct prpl *ret) |
| 2665 { | 2669 { |
| 2666 struct proto_user_opt *puo; | 2670 struct proto_user_opt *puo; |
| 2667 ret->protocol = PROTO_IRC; | 2671 ret->protocol = PROTO_IRC; |
