Commit 7660a276 authored by JC Brand's avatar JC Brand

Store image hash from presence on the occupant

parent 8c3f379d
......@@ -48,6 +48,7 @@
Strophe.addNamespace('SID', 'urn:xmpp:sid:0');
Strophe.addNamespace('SPOILER', 'urn:xmpp:spoiler:0');
Strophe.addNamespace('XFORM', 'jabber:x:data');
Strophe.addNamespace('VCARDUPDATE', 'vcard-temp:x:update');
// Use Mustache style syntax for variable interpolation
/* Configuration of Lodash templates (this config is distinct to the
......
......@@ -785,9 +785,9 @@
parsePresence (pres) {
const id = Strophe.getResourceFromJid(pres.getAttribute("from"));
const data = {
nick: id,
type: pres.getAttribute("type"),
states: []
'nick': id,
'type': pres.getAttribute("type"),
'states': []
};
_.each(pres.childNodes, function (child) {
switch (child.nodeName) {
......@@ -813,6 +813,8 @@
}
}
});
} else if (child.getAttribute("xmlns") === Strophe.NS.VCARDUPDATE) {
data.image_hash = _.get(child.querySelector('photo'), 'textContent');
}
}
});
......
......@@ -19,7 +19,7 @@
}(this, function (converse, bootstrap, tpl_toolbar_otr, otr) {
"use strict";
const { Strophe, utils, b64_sha1, _ } = converse.env;
const { Strophe, utils, _ } = converse.env;
const HAS_CSPRNG = _.isUndefined(window.crypto) ? false : (
_.isFunction(window.crypto.randomBytes) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment