Mention the actor (if available) when removed from room

This commit is contained in:
JC Brand 2016-11-21 13:10:36 +00:00
parent e02c044ae4
commit 5e9e685219
2 changed files with 9 additions and 2 deletions

View File

@ -611,7 +611,11 @@
expect(view.$('.chat-area').is(':visible')).toBeFalsy();
expect(view.$('.occupants').is(':visible')).toBeFalsy();
var $chat_body = view.$('.chatroom-body');
expect($chat_body.html().trim().indexOf('<p>You have been kicked from this room</p><p>The reason given is: "Avaunt, you cullion!"</p>')).not.toBe(-1);
expect($chat_body.html().trim().indexOf(
'<p>You have been kicked from this room</p>'+
'<p>This action was done by <strong>Fluellen</strong>.</p>'+
'<p>The reason given is: <em>"Avaunt, you cullion!"</em>.</p>'
)).not.toBe(-1);
}));
it("can be saved to, and retrieved from, browserStorage", mock.initConverse(function (converse) {

View File

@ -1113,8 +1113,11 @@
var that = this;
if (notification.disconnected) {
this.showDisconnectMessage(notification.disconnection_message);
if (notification.actor) {
this.showDisconnectMessage(__(___('This action was done by <strong>%1$s</strong>.'), notification.actor));
}
if (notification.reason) {
this.showDisconnectMessage(__('The reason given is: "'+notification.reason+'"'), true);
this.showDisconnectMessage(__(___('The reason given is: <em>"%1$s"</em>.'), notification.reason));
}
this.model.set('connection_status', Strophe.Status.DISCONNECTED);
return;