|
@@ -490,7 +490,7 @@
|
|
nick = mock.chatroom_names[0],
|
|
nick = mock.chatroom_names[0],
|
|
msg = $msg({
|
|
msg = $msg({
|
|
'from': 'lounge@montague.lit/'+nick,
|
|
'from': 'lounge@montague.lit/'+nick,
|
|
- 'id': (new Date()).getTime(),
|
|
|
|
|
|
+ 'id': u.getUniqueId(),
|
|
'to': 'romeo@montague.lit',
|
|
'to': 'romeo@montague.lit',
|
|
'type': 'groupchat'
|
|
'type': 'groupchat'
|
|
}).c('body').t(message).tree();
|
|
}).c('body').t(message).tree();
|
|
@@ -521,7 +521,7 @@
|
|
nick = mock.chatroom_names[0],
|
|
nick = mock.chatroom_names[0],
|
|
msg = $msg({
|
|
msg = $msg({
|
|
'from': 'lounge@montague.lit/'+nick,
|
|
'from': 'lounge@montague.lit/'+nick,
|
|
- 'id': (new Date()).getTime(),
|
|
|
|
|
|
+ 'id': u.getUniqueId(),
|
|
'to': 'romeo@montague.lit',
|
|
'to': 'romeo@montague.lit',
|
|
'type': 'groupchat'
|
|
'type': 'groupchat'
|
|
}).c('body').t(message).tree();
|
|
}).c('body').t(message).tree();
|
|
@@ -644,7 +644,7 @@
|
|
|
|
|
|
const msg = $msg({
|
|
const msg = $msg({
|
|
'from': 'coven@chat.shakespeare.lit/some1',
|
|
'from': 'coven@chat.shakespeare.lit/some1',
|
|
- 'id': (new Date()).getTime(),
|
|
|
|
|
|
+ 'id': u.getUniqueId(),
|
|
'to': 'romeo@montague.lit',
|
|
'to': 'romeo@montague.lit',
|
|
'type': 'groupchat'
|
|
'type': 'groupchat'
|
|
}).c('body').t('hello world').tree();
|
|
}).c('body').t('hello world').tree();
|
|
@@ -1109,7 +1109,7 @@
|
|
const view = _converse.chatboxviews.get('conversations@conference.siacs.eu');
|
|
const view = _converse.chatboxviews.get('conversations@conference.siacs.eu');
|
|
const msg = $msg({
|
|
const msg = $msg({
|
|
'from': 'conversations@conference.siacs.eu/romeo',
|
|
'from': 'conversations@conference.siacs.eu/romeo',
|
|
- 'id': (new Date()).getTime(),
|
|
|
|
|
|
+ 'id': u.getUniqueId(),
|
|
'to': 'romeo@montague.lit',
|
|
'to': 'romeo@montague.lit',
|
|
'type': 'groupchat'
|
|
'type': 'groupchat'
|
|
}).c('body').t('Some message').tree();
|
|
}).c('body').t('Some message').tree();
|
|
@@ -1325,7 +1325,7 @@
|
|
const nick = mock.chatroom_names[0];
|
|
const nick = mock.chatroom_names[0];
|
|
let msg = $msg({
|
|
let msg = $msg({
|
|
'from': 'lounge@montague.lit/'+nick,
|
|
'from': 'lounge@montague.lit/'+nick,
|
|
- 'id': (new Date()).getTime(),
|
|
|
|
|
|
+ 'id': u.getUniqueId(),
|
|
'to': 'romeo@montague.lit',
|
|
'to': 'romeo@montague.lit',
|
|
'type': 'groupchat'
|
|
'type': 'groupchat'
|
|
}).c('body').t(message).tree();
|
|
}).c('body').t(message).tree();
|
|
@@ -1336,7 +1336,7 @@
|
|
message = '/me is as well';
|
|
message = '/me is as well';
|
|
msg = $msg({
|
|
msg = $msg({
|
|
from: 'lounge@montague.lit/Romeo Montague',
|
|
from: 'lounge@montague.lit/Romeo Montague',
|
|
- id: (new Date()).getTime(),
|
|
|
|
|
|
+ id: u.getUniqueId(),
|
|
to: 'romeo@montague.lit',
|
|
to: 'romeo@montague.lit',
|
|
type: 'groupchat'
|
|
type: 'groupchat'
|
|
}).c('body').t(message).tree();
|
|
}).c('body').t(message).tree();
|
|
@@ -2134,7 +2134,7 @@
|
|
from: 'lounge@montague.lit/someone',
|
|
from: 'lounge@montague.lit/someone',
|
|
to: 'romeo@montague.lit.com',
|
|
to: 'romeo@montague.lit.com',
|
|
type: 'groupchat',
|
|
type: 'groupchat',
|
|
- id: (new Date()).getTime(),
|
|
|
|
|
|
+ id: u.getUniqueId(),
|
|
}).c('body').t('Message: '+i).tree())
|
|
}).c('body').t('Message: '+i).tree())
|
|
);
|
|
);
|
|
}
|
|
}
|
|
@@ -2147,7 +2147,7 @@
|
|
from: 'lounge@montague.lit/someone',
|
|
from: 'lounge@montague.lit/someone',
|
|
to: 'romeo@montague.lit.com',
|
|
to: 'romeo@montague.lit.com',
|
|
type: 'groupchat',
|
|
type: 'groupchat',
|
|
- id: (new Date()).getTime(),
|
|
|
|
|
|
+ id: u.getUniqueId(),
|
|
}).c('body').t(message).tree());
|
|
}).c('body').t(message).tree());
|
|
// Now check that the message appears inside the chatbox in the DOM
|
|
// Now check that the message appears inside the chatbox in the DOM
|
|
const chat_content = view.el.querySelector('.chat-content');
|
|
const chat_content = view.el.querySelector('.chat-content');
|
|
@@ -4948,7 +4948,7 @@
|
|
|
|
|
|
await view.model.onMessage($msg({
|
|
await view.model.onMessage($msg({
|
|
from: muc_jid+'/'+nick,
|
|
from: muc_jid+'/'+nick,
|
|
- id: (new Date()).getTime(),
|
|
|
|
|
|
+ id: u.getUniqueId(),
|
|
to: 'romeo@montague.lit',
|
|
to: 'romeo@montague.lit',
|
|
type: 'groupchat'
|
|
type: 'groupchat'
|
|
}).c('body').t(message).tree());
|
|
}).c('body').t(message).tree());
|
|
@@ -4959,7 +4959,7 @@
|
|
|
|
|
|
await view.model.onMessage($msg({
|
|
await view.model.onMessage($msg({
|
|
'from': muc_jid+'/'+nick,
|
|
'from': muc_jid+'/'+nick,
|
|
- 'id': (new Date()).getTime(),
|
|
|
|
|
|
+ 'id': u.getUniqueId(),
|
|
'to': 'romeo@montague.lit',
|
|
'to': 'romeo@montague.lit',
|
|
'type': 'groupchat'
|
|
'type': 'groupchat'
|
|
}).c('body').t(message).tree());
|
|
}).c('body').t(message).tree());
|
|
@@ -5078,7 +5078,7 @@
|
|
// <composing> state
|
|
// <composing> state
|
|
let msg = $msg({
|
|
let msg = $msg({
|
|
from: muc_jid+'/newguy',
|
|
from: muc_jid+'/newguy',
|
|
- id: (new Date()).getTime(),
|
|
|
|
|
|
+ id: u.getUniqueId(),
|
|
to: 'romeo@montague.lit',
|
|
to: 'romeo@montague.lit',
|
|
type: 'groupchat'
|
|
type: 'groupchat'
|
|
}).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
}).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
@@ -5103,7 +5103,7 @@
|
|
// Check that it doesn't appear twice
|
|
// Check that it doesn't appear twice
|
|
msg = $msg({
|
|
msg = $msg({
|
|
from: muc_jid+'/newguy',
|
|
from: muc_jid+'/newguy',
|
|
- id: (new Date()).getTime(),
|
|
|
|
|
|
+ id: u.getUniqueId(),
|
|
to: 'romeo@montague.lit',
|
|
to: 'romeo@montague.lit',
|
|
type: 'groupchat'
|
|
type: 'groupchat'
|
|
}).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
}).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
@@ -5123,7 +5123,7 @@
|
|
// <composing> state for a different occupant
|
|
// <composing> state for a different occupant
|
|
msg = $msg({
|
|
msg = $msg({
|
|
from: muc_jid+'/nomorenicks',
|
|
from: muc_jid+'/nomorenicks',
|
|
- id: (new Date()).getTime(),
|
|
|
|
|
|
+ id: u.getUniqueId(),
|
|
to: 'romeo@montague.lit',
|
|
to: 'romeo@montague.lit',
|
|
type: 'groupchat'
|
|
type: 'groupchat'
|
|
}).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
}).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
@@ -5143,7 +5143,7 @@
|
|
// Check that new messages appear under the chat state notifications
|
|
// Check that new messages appear under the chat state notifications
|
|
msg = $msg({
|
|
msg = $msg({
|
|
from: `${muc_jid}/some1`,
|
|
from: `${muc_jid}/some1`,
|
|
- id: (new Date()).getTime(),
|
|
|
|
|
|
+ id: u.getUniqueId(),
|
|
to: 'romeo@montague.lit',
|
|
to: 'romeo@montague.lit',
|
|
type: 'groupchat'
|
|
type: 'groupchat'
|
|
}).c('body').t('hello world').tree();
|
|
}).c('body').t('hello world').tree();
|
|
@@ -5248,7 +5248,7 @@
|
|
// <composing> state
|
|
// <composing> state
|
|
var msg = $msg({
|
|
var msg = $msg({
|
|
from: muc_jid+'/newguy',
|
|
from: muc_jid+'/newguy',
|
|
- id: (new Date()).getTime(),
|
|
|
|
|
|
+ id: u.getUniqueId(),
|
|
to: 'romeo@montague.lit',
|
|
to: 'romeo@montague.lit',
|
|
type: 'groupchat'
|
|
type: 'groupchat'
|
|
}).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
}).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
@@ -5269,7 +5269,7 @@
|
|
// Check that it doesn't appear twice
|
|
// Check that it doesn't appear twice
|
|
msg = $msg({
|
|
msg = $msg({
|
|
from: muc_jid+'/newguy',
|
|
from: muc_jid+'/newguy',
|
|
- id: (new Date()).getTime(),
|
|
|
|
|
|
+ id: u.getUniqueId(),
|
|
to: 'romeo@montague.lit',
|
|
to: 'romeo@montague.lit',
|
|
type: 'groupchat'
|
|
type: 'groupchat'
|
|
}).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
}).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
@@ -5288,7 +5288,7 @@
|
|
// <composing> state for a different occupant
|
|
// <composing> state for a different occupant
|
|
msg = $msg({
|
|
msg = $msg({
|
|
from: muc_jid+'/nomorenicks',
|
|
from: muc_jid+'/nomorenicks',
|
|
- id: (new Date()).getTime(),
|
|
|
|
|
|
+ id: u.getUniqueId(),
|
|
to: 'romeo@montague.lit',
|
|
to: 'romeo@montague.lit',
|
|
type: 'groupchat'
|
|
type: 'groupchat'
|
|
}).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
}).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
@@ -5311,7 +5311,7 @@
|
|
// <paused> state from occupant who typed first
|
|
// <paused> state from occupant who typed first
|
|
msg = $msg({
|
|
msg = $msg({
|
|
from: muc_jid+'/newguy',
|
|
from: muc_jid+'/newguy',
|
|
- id: (new Date()).getTime(),
|
|
|
|
|
|
+ id: u.getUniqueId(),
|
|
to: 'romeo@montague.lit',
|
|
to: 'romeo@montague.lit',
|
|
type: 'groupchat'
|
|
type: 'groupchat'
|
|
}).c('body').c('paused', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|
|
}).c('body').c('paused', {'xmlns': Strophe.NS.CHATSTATES}).tree();
|