|
@@ -1509,6 +1509,17 @@ converse.plugins.add('converse-muc-views', {
|
|
|
return notification;
|
|
|
},
|
|
|
|
|
|
+ insertNotification (message) {
|
|
|
+ this.content.insertAdjacentHTML(
|
|
|
+ 'beforeend',
|
|
|
+ tpl_info({
|
|
|
+ 'isodate': (new Date()).toISOString(),
|
|
|
+ 'extra_classes': 'chat-event',
|
|
|
+ 'message': message
|
|
|
+ })
|
|
|
+ );
|
|
|
+ },
|
|
|
+
|
|
|
showNotificationsforUser (notification) {
|
|
|
/* Given the notification object generated by
|
|
|
* parseXUserElement, display any relevant messages and
|
|
@@ -1527,21 +1538,13 @@ converse.plugins.add('converse-muc-views', {
|
|
|
this.model.save('connection_status', converse.ROOMSTATUS.DISCONNECTED);
|
|
|
return;
|
|
|
}
|
|
|
- notification.messages.forEach(message => {
|
|
|
- this.content.insertAdjacentHTML(
|
|
|
- 'beforeend',
|
|
|
- tpl_info({
|
|
|
- 'isodate': (new Date()).toISOString(),
|
|
|
- 'extra_classes': 'chat-event',
|
|
|
- 'message': message
|
|
|
- }));
|
|
|
- });
|
|
|
- if (notification.reason) {
|
|
|
- this.showChatEvent(__('The reason given is: "%1$s".', notification.reason));
|
|
|
- }
|
|
|
if (_.get(notification.messages, 'length')) {
|
|
|
+ notification.messages.forEach(message => this.insertNotification(message));
|
|
|
this.scrollDown();
|
|
|
}
|
|
|
+ if (notification.reason) {
|
|
|
+ this.showChatEvent(__('The reason given is: "%1$s".', notification.reason));
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
onOccupantAdded (occupant) {
|