Skip to content

Commit

Permalink
allow html in welcome message
Browse files Browse the repository at this point in the history
  • Loading branch information
SSilence committed Apr 7, 2015
1 parent 14d4664 commit 3aed019
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/sum-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ define('sum-backend', Class.extend({
this.initEmojis();

// set welcome message
this.renderSystemMessage(config.welcome_text.replace(/\\n/g, '<br />').replace(/%s/g, this.version), config.room_all);
this.renderSystemMessage(config.welcome_text.replace(/%s/g, this.version), config.room_all, false);

// load rooms where user was in on last logout
this.roomlist = this.backendStorage.loadRoomlist();
Expand Down Expand Up @@ -863,18 +863,22 @@ define('sum-backend', Class.extend({
* render system message
* @param text (string) message
* @param conversation (string) target conversation
* @param escape (boolean) escape given text
*/
renderSystemMessage: function(text, conversation) {
renderSystemMessage: function(text, conversation, escape) {
// get conversation
if (typeof this.conversations[conversation] == 'undefined')
this.conversations[conversation] = [];
var con = this.conversations[conversation];

if (typeof escape === 'undefined' || escape !== false)
text = text.escape().replace(/\&lt;br \/\&gt;/g, '<br />');

// add system message
con[con.length] = {
id: this.backendHelpers.genereateGUID(),
type: 'system',
text: text.escape().replace(/\&lt;br \/\&gt;/g, '<br />')
text: text
};
this.getConversation(conversation);
},
Expand Down

0 comments on commit 3aed019

Please sign in to comment.