Explorar el Código

Adds only a single item with a given key to presence.

master
Boris Grozev hace 9 años
padre
commit
0f40e2efd4
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. 5
    3
      modules/xmpp/ChatRoom.js

+ 5
- 3
modules/xmpp/ChatRoom.js Ver fichero

326
         {
326
         {
327
             case "nick":
327
             case "nick":
328
                 if(!member.isFocus) {
328
                 if(!member.isFocus) {
329
-                    var displayName = !this.xmpp.options.displayJids
330
-                        ? member.nick : Strophe.getResourceFromJid(from);
329
+                    var displayName = this.xmpp.options.displayJids
330
+                        ? Strophe.getResourceFromJid(from) : member.nick;
331
 
331
 
332
                     if (displayName && displayName.length > 0) {
332
                     if (displayName && displayName.length > 0) {
333
                         this.eventEmitter.emit(
333
                         this.eventEmitter.emit(
352
                 this.phonePin = att.pin || null;
352
                 this.phonePin = att.pin || null;
353
                 this.eventEmitter.emit(XMPPEvents.PHONE_NUMBER_CHANGED);
353
                 this.eventEmitter.emit(XMPPEvents.PHONE_NUMBER_CHANGED);
354
                 break;
354
                 break;
355
-            default :
355
+            default:
356
                 this.processNode(node, from);
356
                 this.processNode(node, from);
357
         }
357
         }
358
     }
358
     }
561
 
561
 
562
 ChatRoom.prototype.addToPresence = function (key, values) {
562
 ChatRoom.prototype.addToPresence = function (key, values) {
563
     values.tagName = key;
563
     values.tagName = key;
564
+    this.removeFromPresence(key);
565
+    this.presMap.nodes.push(values);
564
     this.presMap["nodes"].push(values);
566
     this.presMap["nodes"].push(values);
565
 };
567
 };
566
 
568
 

Loading…
Cancelar
Guardar