2
0
Эх сурвалжийг харах

Store image hash from presence on the occupant

JC Brand 7 жил өмнө
parent
commit
7660a27682

+ 1 - 0
src/converse-core.js

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

+ 5 - 3
src/converse-muc.js

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

+ 1 - 1
src/converse-otr.js

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