mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
trigger pusher on system messages too
This commit is contained in:
@@ -351,6 +351,12 @@ schema.methods.sendChat = function sendChat (message, user) {
|
|||||||
|
|
||||||
User.update(query, lastSeenUpdate, {multi: true}).exec();
|
User.update(query, lastSeenUpdate, {multi: true}).exec();
|
||||||
|
|
||||||
|
// If the message being sent is a system message (not gone through the api.postChat controller)
|
||||||
|
// then notify Pusher about it (only parties for now)
|
||||||
|
if (newMessage.uuid === 'system' && this.privacy === 'private' && this.type === 'party') {
|
||||||
|
pusher.trigger(`presence-group-${this._id}`, 'new-chat', newMessage);
|
||||||
|
}
|
||||||
|
|
||||||
return newMessage;
|
return newMessage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user