Add method hook for adding more attrs to send to the message template
This commit is contained in:
parent
1666a45c6b
commit
d6ef4fc5ca
@ -254,6 +254,12 @@
|
|||||||
)(this.renderMessage(attrs));
|
)(this.renderMessage(attrs));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getExtraMessageTemplateAttributes: function (attrs) {
|
||||||
|
// Provides a hook for sending more attributes to the
|
||||||
|
// message template.
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
|
||||||
renderMessage: function (attrs) {
|
renderMessage: function (attrs) {
|
||||||
/* Renders a chat message based on the passed in attributes.
|
/* Renders a chat message based on the passed in attributes.
|
||||||
*
|
*
|
||||||
@ -286,15 +292,17 @@
|
|||||||
// are mentioned.
|
// are mentioned.
|
||||||
extra_classes += ' mentioned';
|
extra_classes += ' mentioned';
|
||||||
}
|
}
|
||||||
return $(template({
|
return $(template(
|
||||||
msgid: attrs.msgid,
|
_.extend(this.getExtraMessageTemplateAttributes(attrs), {
|
||||||
|
'msgid': attrs.msgid,
|
||||||
'sender': attrs.sender,
|
'sender': attrs.sender,
|
||||||
'time': msg_time.format('hh:mm'),
|
'time': msg_time.format('hh:mm'),
|
||||||
'isodate': msg_time.format(),
|
'isodate': msg_time.format(),
|
||||||
'username': username,
|
'username': username,
|
||||||
'message': '',
|
'message': '',
|
||||||
'extra_classes': extra_classes
|
'extra_classes': extra_classes
|
||||||
})).children('.chat-msg-content').first().text(text)
|
})
|
||||||
|
)).children('.chat-msg-content').first().text(text)
|
||||||
.addHyperlinks()
|
.addHyperlinks()
|
||||||
.addEmoticons(converse.visible_toolbar_buttons.emoticons).parent();
|
.addEmoticons(converse.visible_toolbar_buttons.emoticons).parent();
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user