comparison src/protocols/irc/irc.c @ 5588:a569fef2a6b1

[gaim-migrate @ 5992] What the hell did you do, Sean? :P I'm stumped as well. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 31 May 2003 07:12:20 +0000
parents f6650bfe4f51
children 343dbdcc44e2
comparison
equal deleted inserted replaced
5587:1c55b1540e18 5588:a569fef2a6b1
58 #define USEROPT_CHARSET 2 58 #define USEROPT_CHARSET 2
59 59
60 #define DEFAULT_SERVER "irc.freenode.net" 60 #define DEFAULT_SERVER "irc.freenode.net"
61 61
62 static GaimPlugin *my_protocol = NULL; 62 static GaimPlugin *my_protocol = NULL;
63
64 /* for win32 compatability */
65 G_MODULE_IMPORT GSList *connections;
66 63
67 #ifndef INET6_ADDRSTRLEN 64 #ifndef INET6_ADDRSTRLEN
68 #define INET6_ADDRSTRLEN 46 65 #define INET6_ADDRSTRLEN 46
69 #endif 66 #endif
70 67
1245 } 1242 }
1246 } 1243 }
1247 1244
1248 static void 1245 static void
1249 dcc_chat_init(struct dcc_chat *data) { 1246 dcc_chat_init(struct dcc_chat *data) {
1250 if (g_slist_find(connections, data->gc)) { 1247 if (g_list_find(gaim_connections_get_all(), data->gc)) {
1251 proxy_connect(data->gc->account, data->ip_address, data->port, dcc_chat_callback, data); 1248 proxy_connect(data->gc->account, data->ip_address, data->port, dcc_chat_callback, data);
1252 } else { 1249 } else {
1253 g_free(data); 1250 g_free(data);
1254 } 1251 }
1255 } 1252 }
1256 1253
1257 static void 1254 static void
1258 dcc_chat_cancel(struct dcc_chat *data){ 1255 dcc_chat_cancel(struct dcc_chat *data){
1259 if (g_slist_find(connections, data->gc) && find_dcc_chat(data->gc, data->nick)) { 1256 if (g_list_find(gaim_connections_get_all(), data->gc) && find_dcc_chat(data->gc, data->nick)) {
1260 dcc_chat_list = g_slist_remove(dcc_chat_list, data); 1257 dcc_chat_list = g_slist_remove(dcc_chat_list, data);
1261 gaim_input_remove (data->inpa); 1258 gaim_input_remove (data->inpa);
1262 close (data->fd); 1259 close (data->fd);
1263 } 1260 }
1264 g_free(data); 1261 g_free(data);
1879 char buf[IRC_BUF_LEN]; 1876 char buf[IRC_BUF_LEN];
1880 char *test; 1877 char *test;
1881 const char *charset = gaim_account_get_string(account, "charset", "UTF-8"); 1878 const char *charset = gaim_account_get_string(account, "charset", "UTF-8");
1882 GError *err = NULL; 1879 GError *err = NULL;
1883 1880
1884 if (!g_slist_find(connections, gc)) { 1881 if (!g_list_find(gaim_connections_get_all(), gc)) {
1885 close(source); 1882 close(source);
1886 return; 1883 return;
1887 } 1884 }
1888 1885
1889 idata = gc->proto_data; 1886 idata = gc->proto_data;
2540 struct gaim_conversation *c = gaim_find_chat(gc, id); 2537 struct gaim_conversation *c = gaim_find_chat(gc, id);
2541 if (!c) 2538 if (!c)
2542 return -EINVAL; 2539 return -EINVAL;
2543 if (send_msg(gc, c->name, what) > 0) 2540 if (send_msg(gc, c->name, what) > 0)
2544 serv_got_chat_in(gc, gaim_chat_get_id(GAIM_CHAT(c)), 2541 serv_got_chat_in(gc, gaim_chat_get_id(GAIM_CHAT(c)),
2545 gaim_connection_get_display_name(gc), 0, what, time(NULL)); 2542 (char *)gaim_connection_get_display_name(gc), 0, what, time(NULL));
2546 return 0; 2543 return 0;
2547 } 2544 }
2548 2545
2549 static GList * 2546 static GList *
2550 irc_away_states(GaimConnection *gc) 2547 irc_away_states(GaimConnection *gc)