# HG changeset patch # User Paul Aurich # Date 1242712610 0 # Node ID 56460ebd15587d8299b02871db60ec9097fc738d # Parent ed5aec1cff447514533ae14a7f0ed540516b8546 This whole section was partially using spaces instead of tabs. diff -r ed5aec1cff44 -r 56460ebd1558 libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Tue May 19 05:49:34 2009 +0000 +++ b/libpurple/protocols/jabber/buddy.c Tue May 19 05:56:50 2009 +0000 @@ -1460,50 +1460,50 @@ if(seconds) { char *end = NULL; long sec = strtol(seconds, &end, 10); - JabberBuddy *jb = NULL; - char *resource = NULL; - char *buddy_name = NULL; + JabberBuddy *jb = NULL; + char *resource = NULL; + char *buddy_name = NULL; JabberBuddyResource *jbr = NULL; - if(end != seconds) { + if(end != seconds) { JabberBuddyInfoResource *jbir = g_hash_table_lookup(jbi->resources, resource_name); if(jbir) { jbir->idle_seconds = sec; } } - /* Update the idle time of the buddy resource, if we got it. - This will correct the value when a server doesn't mark - delayed presence and we got the presence when signing on */ - jb = jabber_buddy_find(js, from, FALSE); - if (jb) { - resource = jabber_get_resource(from); - buddy_name = jabber_get_bare_jid(from); - /* if the resource already has an idle time set, we - must have gotten it originally from a presence. In - this case we update it. Otherwise don't update it, to - avoid setting an idle and not getting informed about - the resource getting unidle */ - if (resource && buddy_name) { - jbr = jabber_buddy_find_resource(jb, resource); - if (jbr) { - if (jbr->idle) { - if (sec) { - jbr->idle = time(NULL) - sec; - } else { - jbr->idle = 0; - } + /* Update the idle time of the buddy resource, if we got it. + This will correct the value when a server doesn't mark + delayed presence and we got the presence when signing on */ + jb = jabber_buddy_find(js, from, FALSE); + if (jb) { + resource = jabber_get_resource(from); + buddy_name = jabber_get_bare_jid(from); + /* if the resource already has an idle time set, we + must have gotten it originally from a presence. In + this case we update it. Otherwise don't update it, to + avoid setting an idle and not getting informed about + the resource getting unidle */ + if (resource && buddy_name) { + jbr = jabber_buddy_find_resource(jb, resource); + if (jbr) { + if (jbr->idle) { + if (sec) { + jbr->idle = time(NULL) - sec; + } else { + jbr->idle = 0; + } - if (jbr == - jabber_buddy_find_resource(jb, NULL)) { - purple_prpl_got_user_idle(js->gc->account, - buddy_name, jbr->idle, jbr->idle); - } - } - } - } - g_free(resource); - g_free(buddy_name); - } + if (jbr == + jabber_buddy_find_resource(jb, NULL)) { + purple_prpl_got_user_idle(js->gc->account, + buddy_name, jbr->idle, jbr->idle); + } + } + } + } + g_free(resource); + g_free(buddy_name); + } } } }