Commit 29638309 authored by JC Brand's avatar JC Brand

Trigger `sendMessage` event

parent 6cd2fac3
...@@ -997,6 +997,16 @@ converse.plugins.add('converse-chat', { ...@@ -997,6 +997,16 @@ converse.plugins.add('converse-chat', {
message = await this.createMessage(attrs); message = await this.createMessage(attrs);
} }
api.send(this.createMessageStanza(message)); api.send(this.createMessageStanza(message));
/**
* Triggered when a message is being sent out
* @event _converse#sendMessage
* @type { Object }
* @property { Object } data
* @property { (_converse.ChatBox | _converse.ChatRoom) } data.chatbox
* @property { (_converse.Message | _converse.ChatRoomMessage } data.message
*/
api.trigger('sendMessage', {'chatbox': this, message});
return message; return message;
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment