comparison libpurple/protocols/irc/irc.c @ 31822:6c660dc7cb6a

Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong. applied changes from 3de680fff7ddd1b00149657afb7f6cd833000a90 through 7ee5e1d431651ed2b1a54bc942d63f35580af55c applied changes from e7c103fdfbc59bb2ca41a3c8813c4ff2847a673f through 22937ab220c41cd0c4a3f9e21e3db687db80da75 applied changes from 22937ab220c41cd0c4a3f9e21e3db687db80da75 through cba010d1c097d4e6599f08276ed9d894710c1074 applied changes from a694289accbec14c593b3636ef1f626fd8279805 through 8a43e3ddd7adacb208afe2d7ee3ea983c95901be
author Evan Schoenberg <evan.s@dreskin.net>
date Mon, 21 Feb 2011 23:08:47 +0000
parents e023b0378887
children 90bff83c91cf
comparison
equal deleted inserted replaced
31821:17a4b32f4d46 31822:6c660dc7cb6a
39 39
40 #define PING_TIMEOUT 60 40 #define PING_TIMEOUT 60
41 41
42 static void irc_ison_buddy_init(char *name, struct irc_buddy *ib, GList **list); 42 static void irc_ison_buddy_init(char *name, struct irc_buddy *ib, GList **list);
43 43
44 static void irc_who_channel(PurpleConversation *conv, struct irc_conn *irc);
45
44 static const char *irc_blist_icon(PurpleAccount *a, PurpleBuddy *b); 46 static const char *irc_blist_icon(PurpleAccount *a, PurpleBuddy *b);
45 static GList *irc_status_types(PurpleAccount *account); 47 static GList *irc_status_types(PurpleAccount *account);
46 static GList *irc_actions(PurplePlugin *plugin, gpointer context); 48 static GList *irc_actions(PurplePlugin *plugin, gpointer context);
47 /* static GList *irc_chat_info(PurpleConnection *gc); */ 49 /* static GList *irc_chat_info(PurpleConnection *gc); */
48 static void irc_login(PurpleAccount *account); 50 static void irc_login(PurpleAccount *account);
230 static void irc_ison_buddy_init(char *name, struct irc_buddy *ib, GList **list) 232 static void irc_ison_buddy_init(char *name, struct irc_buddy *ib, GList **list)
231 { 233 {
232 *list = g_list_append(*list, ib); 234 *list = g_list_append(*list, ib);
233 } 235 }
234 236
237
238 gboolean irc_who_channel_timeout(struct irc_conn *irc)
239 {
240 // WHO all of our channels.
241 g_list_foreach(purple_get_conversations(), (GFunc)irc_who_channel, (gpointer)irc);
242
243 return TRUE;
244 }
245
246 static void irc_who_channel(PurpleConversation *conv, struct irc_conn *irc)
247 {
248 if (purple_conversation_get_account(conv) == irc->account && purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
249 char *buf = irc_format(irc, "vc", "WHO", purple_conversation_get_name(conv));
250
251 purple_debug(PURPLE_DEBUG_INFO, "irc", "Performing periodic who on %s", purple_conversation_get_name(conv));
252 irc_send(irc, buf);
253 g_free(buf);
254 }
255 }
256
235 static void irc_ison_one(struct irc_conn *irc, struct irc_buddy *ib) 257 static void irc_ison_one(struct irc_conn *irc, struct irc_buddy *ib)
236 { 258 {
237 char *buf; 259 char *buf;
238 260
239 if (irc->buddies_outstanding != NULL) { 261 if (irc->buddies_outstanding != NULL) {
515 } else if (irc->fd >= 0) { 537 } else if (irc->fd >= 0) {
516 close(irc->fd); 538 close(irc->fd);
517 } 539 }
518 if (irc->timer) 540 if (irc->timer)
519 purple_timeout_remove(irc->timer); 541 purple_timeout_remove(irc->timer);
542 if (irc->who_channel_timer)
543 purple_timeout_remove(irc->who_channel_timer);
520 g_hash_table_destroy(irc->cmds); 544 g_hash_table_destroy(irc->cmds);
521 g_hash_table_destroy(irc->msgs); 545 g_hash_table_destroy(irc->msgs);
522 g_hash_table_destroy(irc->buddies); 546 g_hash_table_destroy(irc->buddies);
523 if (irc->motd) 547 if (irc->motd)
524 g_string_free(irc->motd, TRUE); 548 g_string_free(irc->motd, TRUE);