mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
chat: New chatSendMessage
client-side hook
This commit is contained in:
parent
4c2f7f9a11
commit
9fbd2e5c3d
4 changed files with 71 additions and 3 deletions
|
@ -100,10 +100,12 @@ exports.chat = (() => {
|
|||
}
|
||||
}
|
||||
},
|
||||
send() {
|
||||
async send() {
|
||||
const text = $('#chatinput').val();
|
||||
if (text.replace(/\s+/, '').length === 0) return;
|
||||
this._pad.collabClient.sendMessage({type: 'CHAT_MESSAGE', message: new ChatMessage(text)});
|
||||
const message = new ChatMessage(text);
|
||||
await hooks.aCallAll('chatSendMessage', Object.freeze({message}));
|
||||
this._pad.collabClient.sendMessage({type: 'CHAT_MESSAGE', message});
|
||||
$('#chatinput').val('');
|
||||
},
|
||||
async addMessage(msg, increment, isHistoryAdd) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue