From d1e28e44caefef8ebd0df0817cea2a6859e41faa Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 21 Feb 2013 08:14:41 +0000 Subject: [PATCH] Revert "Commented self presence handling #151" This reverts commit 872726c5aa2bad5ff9f49fa7b8d0a55f6603cb26. --- src/xmpp/connection.c | 6 +++--- src/xmpp/presence.c | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index 220c09c9..bdbf948c 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -94,8 +94,8 @@ jabber_init(const int disable_tls) jabber_conn.tls_disabled = disable_tls; presence_init(); caps_init(); -// available_resources = g_hash_table_new_full(g_str_hash, g_str_equal, free, -// (GDestroyNotify)resource_destroy); + available_resources = g_hash_table_new_full(g_str_hash, g_str_equal, free, + (GDestroyNotify)resource_destroy); } jabber_conn_status_t @@ -283,7 +283,7 @@ connection_free_resources(void) FREE_SET_NULL(saved_details.altdomain); FREE_SET_NULL(saved_account.name); FREE_SET_NULL(saved_account.passwd); -// g_hash_table_remove_all(available_resources); + g_hash_table_remove_all(available_resources); chat_sessions_clear(); presence_free_sub_requests(); xmpp_conn_release(jabber_conn.conn); diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c index 506d57d8..28e2039e 100644 --- a/src/xmpp/presence.c +++ b/src/xmpp/presence.c @@ -343,13 +343,10 @@ _unavailable_handler(xmpp_conn_t * const conn, if (strcmp(my_jid->barejid, from_jid->barejid) !=0) { prof_handle_contact_offline(from_jid->barejid, from_jid->resourcepart, status_str); -/* } else { connection_remove_available_resource(from_jid->resourcepart); -*/ } - jid_destroy(my_jid); jid_destroy(from_jid); @@ -430,17 +427,14 @@ _available_handler(xmpp_conn_t * const conn, Resource *resource = resource_new(from_jid->resourcepart, presence, status_str, priority, caps_key); prof_handle_contact_online(from_jid->barejid, resource, last_activity); -/* } else { // handle self presence resource_presence_t presence = resource_presence_from_string(show_str); Resource *resource = resource_new(from_jid->resourcepart, presence, status_str, priority, caps_key); connection_add_available_resource(resource); -*/ } - jid_destroy(my_jid); jid_destroy(from_jid);