mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
chat: Promisify addMessage()
This commit is contained in:
parent
3f7f629eeb
commit
caac4bf711
1 changed files with 39 additions and 41 deletions
|
@ -105,7 +105,7 @@ exports.chat = (() => {
|
|||
this._pad.collabClient.sendMessage({type: 'CHAT_MESSAGE', text});
|
||||
$('#chatinput').val('');
|
||||
},
|
||||
addMessage(msg, increment, isHistoryAdd) {
|
||||
async addMessage(msg, increment, isHistoryAdd) {
|
||||
// correct the time
|
||||
msg.time += this._pad.clientTimeOffset;
|
||||
|
||||
|
@ -161,8 +161,7 @@ exports.chat = (() => {
|
|||
ctx.sticky = true;
|
||||
}
|
||||
|
||||
// Call chat message hook
|
||||
hooks.aCallAll('chatNewMessage', ctx, () => {
|
||||
await hooks.aCallAll('chatNewMessage', ctx);
|
||||
const cls = authorClass(ctx.author);
|
||||
const chatMsg = $('<p>')
|
||||
.attr('data-authorId', ctx.author)
|
||||
|
@ -203,7 +202,6 @@ exports.chat = (() => {
|
|||
}
|
||||
}
|
||||
if (!isHistoryAdd) this.scrollDown();
|
||||
});
|
||||
},
|
||||
init(pad) {
|
||||
this._pad = pad;
|
||||
|
|
Loading…
Reference in a new issue