Mercurial > pidgin
diff libpurple/protocols/jabber/jabber.c @ 25198:e9b7e41dc816
A first stab at supporting the upcoming new use-case in XMPP XEP-0012
to provide info on idleness in <presence/> stanzas, which allows to track
idle times without polling.
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Sun, 16 Nov 2008 22:29:00 +0000 |
parents | a61c017d3a99 |
children | 3d4ce9df0d48 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c Sun Nov 16 00:10:02 2008 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sun Nov 16 22:29:00 2008 +0000 @@ -1434,8 +1434,14 @@ void jabber_idle_set(PurpleConnection *gc, int idle) { JabberStream *js = gc->proto_data; - + PurpleAccount *account = purple_connection_get_account(gc); + PurpleStatus *status = purple_account_get_active_status(account); + js->idle = idle ? time(NULL) - idle : idle; + + /* send out an updated prescence */ + purple_debug_info("jabber", "sending updated presence for idle\n"); + jabber_presence_send(account, status, TRUE); } void jabber_add_feature(const char *shortname, const char *namespace, JabberFeatureEnabled cb) {