Trigger sendMessage event

This commit is contained in:
JC Brand 2020-04-28 17:46:57 +02:00
parent 6cd2fac33c
commit 2963830916

View File

@ -997,6 +997,16 @@ converse.plugins.add('converse-chat', {
message = await this.createMessage(attrs);
}
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;
},