comparison src/protocols/rendezvous/rendezvous.c @ 9289:a2792c5f3ffd

[gaim-migrate @ 10092] Yay for working idle times on rendezvous. Thanks to proton (Andrew Wellington, no?) of http://www.wiretapped.net/~proton/rendezvous/ committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 15 Jun 2004 04:53:34 +0000
parents 294ae6548d4e
children b3bda982996b
comparison
equal deleted inserted replaced
9288:ab845c8e2afe 9289:a2792c5f3ffd
143 return; 143 return;
144 144
145 serv_got_update(gc, b->name, 0, 0, 0, 0, 0); 145 serv_got_update(gc, b->name, 0, 0, 0, 0, 0);
146 gaim_blist_remove_buddy(b); 146 gaim_blist_remove_buddy(b);
147 /* XXX - This results in incorrect group counts--needs to be fixed in the core */ 147 /* XXX - This results in incorrect group counts--needs to be fixed in the core */
148 /* XXX - We also need to call remove_idle_buddy() in server.c for idle buddies */
148 149
149 /* 150 /*
150 * XXX - Instead of removing immediately, wait 10 seconds and THEN remove 151 * XXX - Instead of removing immediately, wait 10 seconds and THEN remove
151 * them. If you do it immediately you don't see the door close icon. 152 * them. If you do it immediately you don't see the door close icon.
152 */ 153 */
250 rb->status = 0; 251 rb->status = 0;
251 } else if (!strcmp(node1->value, "away")) { 252 } else if (!strcmp(node1->value, "away")) {
252 /* Idle */ 253 /* Idle */
253 node2 = mdns_txt_find(rdata, "away"); 254 node2 = mdns_txt_find(rdata, "away");
254 if ((node2 != NULL) && (node2->value)) { 255 if ((node2 != NULL) && (node2->value)) {
256 /* Time is seconds since January 1st 2001 GMT */
255 rb->idle = atoi(node2->value); 257 rb->idle = atoi(node2->value);
256 gaim_debug_error("XXX", "User has been idle since %d\n", rb->idle); 258 rb->idle += 978307200; /* convert to seconds-since-epoch */
257 } 259 }
258 rb->status = UC_IDLE; 260 rb->status = UC_IDLE;
259 } else if (!strcmp(node1->value, "dnd")) { 261 } else if (!strcmp(node1->value, "dnd")) {
260 /* Away */ 262 /* Away */
261 rb->status = UC_UNAVAILABLE; 263 rb->status = UC_UNAVAILABLE;
262 } 264 }
263 serv_got_update(gc, name, 1, 0, 0, 0, rb->status); 265 serv_got_update(gc, name, 1, 0, 0, rb->idle, rb->status);
264 } 266 }
265 267
266 node1 = mdns_txt_find(rdata, "msg"); 268 node1 = mdns_txt_find(rdata, "msg");
267 if ((node1 != NULL) && (node1->value != NULL)) { 269 if ((node1 != NULL) && (node1->value != NULL)) {
268 g_free(rb->msg); 270 g_free(rb->msg);