Mercurial > pidgin
comparison src/oscar.c @ 891:fa2feef25e1e
[gaim-migrate @ 901]
Oscar options?
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 12 Sep 2000 22:59:36 +0000 |
parents | 41bfae606d39 |
children | e18815f5a4e9 |
comparison
equal
deleted
inserted
replaced
890:1fd6a31679f3 | 891:fa2feef25e1e |
---|---|
50 struct aim_session_t *gaim_sess = NULL; | 50 struct aim_session_t *gaim_sess = NULL; |
51 struct aim_conn_t *gaim_conn; | 51 struct aim_conn_t *gaim_conn; |
52 int gaim_caps = AIM_CAPS_CHAT | AIM_CAPS_SENDFILE | AIM_CAPS_GETFILE | | 52 int gaim_caps = AIM_CAPS_CHAT | AIM_CAPS_SENDFILE | AIM_CAPS_GETFILE | |
53 AIM_CAPS_VOICE | AIM_CAPS_IMIMAGE | AIM_CAPS_BUDDYICON; | 53 AIM_CAPS_VOICE | AIM_CAPS_IMIMAGE | AIM_CAPS_BUDDYICON; |
54 int USE_OSCAR = 0; | 54 int USE_OSCAR = 0; |
55 int keepalv = -1; | |
55 | 56 |
56 GList *oscar_chats = NULL; | 57 GList *oscar_chats = NULL; |
57 | 58 |
58 struct chat_connection *find_oscar_chat(char *name) { | 59 struct chat_connection *find_oscar_chat(char *name) { |
59 GList *g = oscar_chats; | 60 GList *g = oscar_chats; |
859 debug_print(debug_buff); | 860 debug_print(debug_buff); |
860 if (id != 4) | 861 if (id != 4) |
861 do_error_dialog(_("Your connection may be lost."), | 862 do_error_dialog(_("Your connection may be lost."), |
862 _("AOL error")); | 863 _("AOL error")); |
863 | 864 |
865 if (keepalv < 0) | |
866 update_keepalive(TRUE); | |
867 | |
864 return 1; | 868 return 1; |
865 } | 869 } |
866 | 870 |
867 int gaim_chatnav_info(struct aim_session_t *sess, | 871 int gaim_chatnav_info(struct aim_session_t *sess, |
868 struct command_rx_struct *command, ...) { | 872 struct command_rx_struct *command, ...) { |
1215 struct conversation *cnv = find_conversation(name); /* this will never be null because it just got set up */ | 1219 struct conversation *cnv = find_conversation(name); /* this will never be null because it just got set up */ |
1216 cnv->conn = newconn; | 1220 cnv->conn = newconn; |
1217 cnv->watcher = gdk_input_add(newconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, oscar_callback, newconn); | 1221 cnv->watcher = gdk_input_add(newconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, oscar_callback, newconn); |
1218 aim_conn_addhandler(gaim_sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINITIATE, gaim_directim_initiate, 0); | 1222 aim_conn_addhandler(gaim_sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINITIATE, gaim_directim_initiate, 0); |
1219 } | 1223 } |
1224 | |
1225 void send_keepalive(gpointer d) { | |
1226 debug_print("sending oscar NOP\n"); | |
1227 if (USE_OSCAR) { /* keeping it open for TOC */ | |
1228 aim_flap_nop(gaim_sess, gaim_conn); | |
1229 } else { | |
1230 } | |
1231 } | |
1232 | |
1233 void update_keepalive(gboolean on) { | |
1234 if (on && keepalv < 0 && blist) { | |
1235 debug_print("allowing NOP\n"); | |
1236 keepalv = gtk_timeout_add(60000, (GtkFunction)send_keepalive, 0); | |
1237 } else if (!on && keepalv > -1) { | |
1238 debug_print("removing NOP\n"); | |
1239 gtk_timeout_remove(keepalv); | |
1240 keepalv = -1; | |
1241 } | |
1242 } |