mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
chat: Allow chatNewMessage
hook to control rendering
This commit is contained in:
parent
2597b940f4
commit
f1f4ed7c58
4 changed files with 27 additions and 6 deletions
|
@ -132,6 +132,7 @@ exports.chat = (() => {
|
|||
author: msg.userId,
|
||||
text: padutils.escapeHtmlWithClickableLinks(msg.text, '_blank'),
|
||||
message: msg,
|
||||
rendered: null,
|
||||
sticky: false,
|
||||
timestamp: msg.time,
|
||||
timeStr: (() => {
|
||||
|
@ -164,7 +165,7 @@ exports.chat = (() => {
|
|||
|
||||
await hooks.aCallAll('chatNewMessage', ctx);
|
||||
const cls = authorClass(ctx.author);
|
||||
const chatMsg = $('<p>')
|
||||
const chatMsg = ctx.rendered != null ? $(ctx.rendered) : $('<p>')
|
||||
.attr('data-authorId', ctx.author)
|
||||
.addClass(cls)
|
||||
.append($('<b>').text(`${ctx.authorName}:`))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue