Browse Source

cleanup: Removes the user-agent string from presence (unused).

master
Boris Grozev 6 years ago
parent
commit
5b6e7dcf57
2 changed files with 6 additions and 11 deletions
  1. 0
    5
      modules/xmpp/ChatRoom.js
  2. 6
    6
      modules/xmpp/ChatRoom.spec.js

+ 0
- 5
modules/xmpp/ChatRoom.js View File

182
         this.presMap.to = this.myroomjid;
182
         this.presMap.to = this.myroomjid;
183
         this.presMap.xns = 'http://jabber.org/protocol/muc';
183
         this.presMap.xns = 'http://jabber.org/protocol/muc';
184
         this.presMap.nodes = [];
184
         this.presMap.nodes = [];
185
-        this.presMap.nodes.push({
186
-            'tagName': 'user-agent',
187
-            'value': navigator.userAgent,
188
-            'attributes': { xmlns: 'http://jitsi.org/jitmeet/user-agent' }
189
-        });
190
 
185
 
191
         if (options.enableStatsID) {
186
         if (options.enableStatsID) {
192
             this.presMap.nodes.push({
187
             this.presMap.nodes.push({

+ 6
- 6
modules/xmpp/ChatRoom.spec.js View File

47
                 to: 'tojid',
47
                 to: 'tojid',
48
                 from: 'fromjid'
48
                 from: 'fromjid'
49
             })
49
             })
50
-            .c('user-agent').t('user-agent-text').up();
50
+            .c('element-name').t('element-name-text').up();
51
 
51
 
52
             parser.packet2JSON(p.tree(), nodes);
52
             parser.packet2JSON(p.tree(), nodes);
53
 
53
 
54
             expect(nodes.length).toBe(1);
54
             expect(nodes.length).toBe(1);
55
-            const userAgent = nodes.find(n => n.tagName === 'user-agent');
55
+            const elem = nodes.find(n => n.tagName === 'element-name');
56
 
56
 
57
-            expect(userAgent).toBeTruthy();
58
-            expect(Object.keys(userAgent.attributes).length).toEqual(0);
59
-            expect(userAgent.children.length).toEqual(0);
60
-            expect(userAgent.value).toEqual('user-agent-text');
57
+            expect(elem).toBeTruthy();
58
+            expect(Object.keys(elem.attributes).length).toEqual(0);
59
+            expect(elem.children.length).toEqual(0);
60
+            expect(elem.value).toEqual('element-name-text');
61
         });
61
         });
62
 
62
 
63
         it('translates elements with children correctly', () => {
63
         it('translates elements with children correctly', () => {

Loading…
Cancel
Save