Просмотр исходного кода

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

master
Boris Grozev 6 лет назад
Родитель
Сommit
5b6e7dcf57
2 измененных файлов: 6 добавлений и 11 удалений
  1. 0
    5
      modules/xmpp/ChatRoom.js
  2. 6
    6
      modules/xmpp/ChatRoom.spec.js

+ 0
- 5
modules/xmpp/ChatRoom.js Просмотреть файл

@@ -182,11 +182,6 @@ export default class ChatRoom extends Listenable {
182 182
         this.presMap.to = this.myroomjid;
183 183
         this.presMap.xns = 'http://jabber.org/protocol/muc';
184 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 186
         if (options.enableStatsID) {
192 187
             this.presMap.nodes.push({

+ 6
- 6
modules/xmpp/ChatRoom.spec.js Просмотреть файл

@@ -47,17 +47,17 @@ describe('ChatRoom', () => {
47 47
                 to: 'tojid',
48 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 52
             parser.packet2JSON(p.tree(), nodes);
53 53
 
54 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 63
         it('translates elements with children correctly', () => {

Загрузка…
Отмена
Сохранить