Emit rejectedMessage when a message is rejected for not being a friend to an...

Emit rejectedMessage when a message is rejected for not being a friend to an user blocking PMs from non-friends
parent 5b4b3816
......@@ -22,6 +22,14 @@ class MessageCommand extends IrcCommand {
* @type {PrivateMessage}
*/
client.emit("PM", new PrivateMessage(user, message, false, client.getSelf()));
else if(splits[2].indexOf("#") === -1)
/**
* Fired when Bancho sends us back a PM that couldn't be sent.
* As far as we know, only happens when a PM is rejected because the recipient blocks messages from non-friends.
* @event BanchoClient#rejectedMessage
* @type {PrivateMessage}
*/
client.emit("rejectedMessage", new PrivateMessage(client.getSelf(), message, true, client.getUser(splits[2])));
else
/**
* Fired when a channel message reaches us.
......
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