| 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 |
|
| 46 static const char *irc_blist_icon(PurpleAccount *a, PurpleBuddy *b); |
44 static const char *irc_blist_icon(PurpleAccount *a, PurpleBuddy *b); |
| 47 static GList *irc_status_types(PurpleAccount *account); |
45 static GList *irc_status_types(PurpleAccount *account); |
| 48 static GList *irc_actions(PurplePlugin *plugin, gpointer context); |
46 static GList *irc_actions(PurplePlugin *plugin, gpointer context); |
| 49 /* static GList *irc_chat_info(PurpleConnection *gc); */ |
47 /* static GList *irc_chat_info(PurpleConnection *gc); */ |
| 50 static void irc_login(PurpleAccount *account); |
48 static void irc_login(PurpleAccount *account); |
| 232 static void irc_ison_buddy_init(char *name, struct irc_buddy *ib, GList **list) |
230 static void irc_ison_buddy_init(char *name, struct irc_buddy *ib, GList **list) |
| 233 { |
231 { |
| 234 *list = g_list_append(*list, ib); |
232 *list = g_list_append(*list, ib); |
| 235 } |
233 } |
| 236 |
234 |
| 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 |
|
| 257 static void irc_ison_one(struct irc_conn *irc, struct irc_buddy *ib) |
235 static void irc_ison_one(struct irc_conn *irc, struct irc_buddy *ib) |
| 258 { |
236 { |
| 259 char *buf; |
237 char *buf; |
| 260 |
238 |
| 261 if (irc->buddies_outstanding != NULL) { |
239 if (irc->buddies_outstanding != NULL) { |
| 537 } else if (irc->fd >= 0) { |
515 } else if (irc->fd >= 0) { |
| 538 close(irc->fd); |
516 close(irc->fd); |
| 539 } |
517 } |
| 540 if (irc->timer) |
518 if (irc->timer) |
| 541 purple_timeout_remove(irc->timer); |
519 purple_timeout_remove(irc->timer); |
| 542 if (irc->who_channel_timer) |
|
| 543 purple_timeout_remove(irc->who_channel_timer); |
|
| 544 g_hash_table_destroy(irc->cmds); |
520 g_hash_table_destroy(irc->cmds); |
| 545 g_hash_table_destroy(irc->msgs); |
521 g_hash_table_destroy(irc->msgs); |
| 546 g_hash_table_destroy(irc->buddies); |
522 g_hash_table_destroy(irc->buddies); |
| 547 if (irc->motd) |
523 if (irc->motd) |
| 548 g_string_free(irc->motd, TRUE); |
524 g_string_free(irc->motd, TRUE); |