Store image hash from presence on the occupant

This commit is contained in:
JC Brand 2018-05-03 13:47:31 +02:00
parent 8c3f379d82
commit 7660a27682
3 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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');
}
}
});

View File

@ -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) ||