about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-05-07 22:22:28 +0100
committerJames Booth <boothj5@gmail.com>2015-05-07 22:22:28 +0100
commit8ebc1d4ac17bbc6b373ecdc3bf9ca5b0ac20b263 (patch)
treede68ac19a0e223b365e5d95638fcb3a884b02a8a /src/xmpp
parent8673488368250314b6e58ed2fb00eeb6d4ce2948 (diff)
downloadprofani-tty-8ebc1d4ac17bbc6b373ecdc3bf9ca5b0ac20b263.tar.gz
Moved pgp signature verification to sv_ev_contact_online
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/presence.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c
index e65b463d..0a7b5c45 100644
--- a/src/xmpp/presence.c
+++ b/src/xmpp/presence.c
@@ -619,16 +619,6 @@ _available_handler(xmpp_conn_t * const conn,
         log_debug("Presence available handler fired for: %s", jid);
     }
 
-#ifdef HAVE_LIBGPGME
-    xmpp_stanza_t *x = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_SIGNED);
-    if (x) {
-        char *sign = xmpp_stanza_get_text(x);
-        if (sign) {
-            p_gpg_verify(xmpp_presence->jid->barejid, sign);
-        }
-    }
-#endif
-
     const char *my_jid_str = xmpp_conn_get_jid(conn);
     Jid *my_jid = jid_create(my_jid_str);
 
@@ -645,7 +635,14 @@ _available_handler(xmpp_conn_t * const conn,
     if (g_strcmp0(xmpp_presence->jid->barejid, my_jid->barejid) == 0) {
         connection_add_available_resource(resource);
     } else {
-        sv_ev_contact_online(xmpp_presence->jid->barejid, resource, xmpp_presence->last_activity);
+        char *pgpsig = NULL;
+        xmpp_stanza_t *x = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_SIGNED);
+        if (x) {
+            pgpsig = xmpp_stanza_get_text(x);
+        }
+        sv_ev_contact_online(xmpp_presence->jid->barejid, resource, xmpp_presence->last_activity, pgpsig);
+        xmpp_ctx_t *ctx = connection_get_ctx();
+        xmpp_free(ctx, pgpsig);
     }
 
     jid_destroy(my_jid);