Create sha-1 of own capabilities once

This commit is contained in:
James Booth
2014-09-23 00:08:26 +01:00
parent 7621a84675
commit 345a9e3f40
3 changed files with 18 additions and 2 deletions

View File

@@ -1198,14 +1198,13 @@ stanza_attach_caps(xmpp_ctx_t * const ctx, xmpp_stanza_t * const presence)
xmpp_stanza_set_ns(caps, STANZA_NS_CAPS);
xmpp_stanza_t *query = caps_create_query_response_stanza(ctx);
char *sha1 = caps_create_sha1_str(query);
char *sha1 = caps_get_my_sha1(ctx);
xmpp_stanza_set_attribute(caps, STANZA_ATTR_HASH, "sha-1");
xmpp_stanza_set_attribute(caps, STANZA_ATTR_NODE, "http://www.profanity.im");
xmpp_stanza_set_attribute(caps, STANZA_ATTR_VER, sha1);
xmpp_stanza_add_child(presence, caps);
xmpp_stanza_release(caps);
xmpp_stanza_release(query);
g_free(sha1);
}
const char *