| 7620 } |
7620 } |
| 7621 list = list->next; |
7621 list = list->next; |
| 7622 } |
7622 } |
| 7623 } |
7623 } |
| 7624 |
7624 |
| |
7625 struct _status_timeout_user { |
| |
7626 gchar *name; |
| |
7627 PurpleAccount *account; |
| |
7628 }; |
| |
7629 |
| 7625 static gboolean |
7630 static gboolean |
| 7626 update_buddy_status_timeout(PurpleBuddy *buddy) |
7631 update_buddy_status_timeout(struct _status_timeout_user *user) |
| 7627 { |
7632 { |
| 7628 /* To remove the signing-on/off door icon */ |
7633 /* To remove the signing-on/off door icon */ |
| 7629 PurpleConversation *conv; |
7634 PurpleConversation *conv; |
| 7630 |
7635 |
| 7631 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, buddy->name, buddy->account); |
7636 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, user->name, user->account); |
| 7632 if (conv) |
7637 if (conv) |
| 7633 pidgin_conv_update_fields(conv, PIDGIN_CONV_TAB_ICON); |
7638 pidgin_conv_update_fields(conv, PIDGIN_CONV_TAB_ICON); |
| 7634 |
7639 |
| |
7640 g_free(user->name); |
| |
7641 g_free(user); |
| |
7642 |
| 7635 return FALSE; |
7643 return FALSE; |
| 7636 } |
7644 } |
| 7637 |
7645 |
| 7638 static void |
7646 static void |
| 7639 update_buddy_status_changed(PurpleBuddy *buddy, PurpleStatus *old, PurpleStatus *newstatus) |
7647 update_buddy_status_changed(PurpleBuddy *buddy, PurpleStatus *old, PurpleStatus *newstatus) |
| 7640 { |
7648 { |
| 7641 PidginConversation *gtkconv; |
7649 PidginConversation *gtkconv; |
| 7642 PurpleConversation *conv; |
7650 PurpleConversation *conv; |
| |
7651 struct _status_timeout_user *user; |
| 7643 |
7652 |
| 7644 gtkconv = get_gtkconv_with_contact(purple_buddy_get_contact(buddy)); |
7653 gtkconv = get_gtkconv_with_contact(purple_buddy_get_contact(buddy)); |
| 7645 if (gtkconv) |
7654 if (gtkconv) |
| 7646 { |
7655 { |
| 7647 conv = gtkconv->active_conv; |
7656 conv = gtkconv->active_conv; |
| 7650 | PIDGIN_CONV_BUDDY_ICON); |
7659 | PIDGIN_CONV_BUDDY_ICON); |
| 7651 if ((purple_status_is_online(old) ^ purple_status_is_online(newstatus)) != 0) |
7660 if ((purple_status_is_online(old) ^ purple_status_is_online(newstatus)) != 0) |
| 7652 pidgin_conv_update_fields(conv, PIDGIN_CONV_MENU); |
7661 pidgin_conv_update_fields(conv, PIDGIN_CONV_MENU); |
| 7653 } |
7662 } |
| 7654 |
7663 |
| |
7664 user = g_malloc(sizeof(struct _status_timeout_user)); |
| |
7665 user->name = g_strdup(buddy->name); |
| |
7666 user->account = buddy->account; |
| |
7667 |
| 7655 /* In case a conversation is started after the buddy has signed-on/off */ |
7668 /* In case a conversation is started after the buddy has signed-on/off */ |
| 7656 purple_timeout_add_seconds(11, (GSourceFunc)update_buddy_status_timeout, buddy); |
7669 purple_timeout_add_seconds(11, (GSourceFunc)update_buddy_status_timeout, user); |
| 7657 } |
7670 } |
| 7658 |
7671 |
| 7659 static void |
7672 static void |
| 7660 update_buddy_privacy_changed(PurpleBuddy *buddy) |
7673 update_buddy_privacy_changed(PurpleBuddy *buddy) |
| 7661 { |
7674 { |