comparison src/blist.c @ 10475:94fd0bf8c4b1

[gaim-migrate @ 11762] sf patch #1094341, from Richard Laager implements sf rfe #1090971 "tracks when a buddy was last seen and displays this value in the tooltip for offline and "signing on" buddies." The changes for this feature were pretty small and self-contained, and it's a neat feature. Then I started changing other things. I changed the way tooltips are created to use GStrings. I think it's easier to make changes without screwing stuff up, and the code is hopefully a bit easier to read through. I also changed how Add a Chat and Join a Chat work slightly. Now PRPLs can specify if a field is required or not, and the dialogs will not allow the user to click on "ok" if the field is not filled in. For example, when joining an oscar chat, the room name MUST be specified. This change and I think something else minor should fix the problem with adding chats to the buddy list that didn't have names. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 05 Jan 2005 05:52:10 +0000
parents 843ed1f2bf3f
children 1a97d5e88d12
comparison
equal deleted inserted replaced
10474:ae1fa1218e5c 10475:94fd0bf8c4b1
101 101
102 name = (const char *)key; 102 name = (const char *)key;
103 value = (GaimValue *)hvalue; 103 value = (GaimValue *)hvalue;
104 node = (xmlnode *)user_data; 104 node = (xmlnode *)user_data;
105 105
106 g_return_if_fail(value != NULL);
107
106 child = xmlnode_new_child(node, "setting"); 108 child = xmlnode_new_child(node, "setting");
107 xmlnode_set_attrib(child, "name", name); 109 xmlnode_set_attrib(child, "name", name);
108 110
109 if (gaim_value_get_type(value) == GAIM_TYPE_INT) { 111 if (gaim_value_get_type(value) == GAIM_TYPE_INT) {
110 xmlnode_set_attrib(child, "type", "int"); 112 xmlnode_set_attrib(child, "type", "int");
766 buddy->timer = gaim_timeout_add(10000, (GSourceFunc)presence_update_timeout_cb, buddy); 768 buddy->timer = gaim_timeout_add(10000, (GSourceFunc)presence_update_timeout_cb, buddy);
767 769
768 } else if (!gaim_status_is_online(status) && 770 } else if (!gaim_status_is_online(status) &&
769 gaim_status_is_online(old_status)) { 771 gaim_status_is_online(old_status)) {
770 buddy->present = GAIM_BUDDY_SIGNING_OFF; 772 buddy->present = GAIM_BUDDY_SIGNING_OFF;
773 gaim_blist_node_set_int(&buddy->node, "last_seen", time(NULL));
771 gaim_signal_emit(gaim_blist_get_handle(), "buddy-signed-off", buddy); 774 gaim_signal_emit(gaim_blist_get_handle(), "buddy-signed-off", buddy);
772 if (buddy->timer > 0) 775 if (buddy->timer > 0)
773 gaim_timeout_remove(buddy->timer); 776 gaim_timeout_remove(buddy->timer);
774 buddy->timer = gaim_timeout_add(10000, (GSourceFunc)presence_update_timeout_cb, buddy); 777 buddy->timer = gaim_timeout_add(10000, (GSourceFunc)presence_update_timeout_cb, buddy);
775 778
2224 if (((GaimBuddy*)bnode)->present == GAIM_BUDDY_ONLINE || 2227 if (((GaimBuddy*)bnode)->present == GAIM_BUDDY_ONLINE ||
2225 ((GaimBuddy*)bnode)->present == GAIM_BUDDY_SIGNING_ON) { 2228 ((GaimBuddy*)bnode)->present == GAIM_BUDDY_SIGNING_ON) {
2226 ((GaimContact*)cnode)->online--; 2229 ((GaimContact*)cnode)->online--;
2227 if (((GaimContact*)cnode)->online == 0) 2230 if (((GaimContact*)cnode)->online == 0)
2228 ((GaimGroup*)gnode)->online--; 2231 ((GaimGroup*)gnode)->online--;
2232 gaim_blist_node_set_int(&((GaimBuddy *)bnode)->node,
2233 "last_seen", time(NULL));
2229 } 2234 }
2230 ((GaimContact*)cnode)->currentsize--; 2235 ((GaimContact*)cnode)->currentsize--;
2231 if (((GaimContact*)cnode)->currentsize == 0) 2236 if (((GaimContact*)cnode)->currentsize == 0)
2232 ((GaimGroup*)gnode)->currentsize--; 2237 ((GaimGroup*)gnode)->currentsize--;
2233 2238