Remove away message from channels

Fixes #3026
This commit is contained in:
Pavel Djundik 2019-11-02 16:53:41 +02:00
parent 064d36a6cc
commit 14c2cf6b0b

View File

@ -29,7 +29,7 @@ module.exports = function(irc, network) {
let user; let user;
switch (chan.type) { switch (chan.type) {
case Chan.Type.QUERY: case Chan.Type.QUERY: {
if (data.nick.toLowerCase() !== chan.name.toLowerCase()) { if (data.nick.toLowerCase() !== chan.name.toLowerCase()) {
return; return;
} }
@ -44,9 +44,19 @@ module.exports = function(irc, network) {
user = chan.getUser(data.nick); user = chan.getUser(data.nick);
break; const msg = new Msg({
type: type,
text: away || "",
time: data.time,
from: user,
});
case Chan.Type.CHANNEL: chan.pushMessage(client, msg);
break;
}
case Chan.Type.CHANNEL: {
user = chan.findUser(data.nick); user = chan.findUser(data.nick);
if (!user || user.away === away) { if (!user || user.away === away) {
@ -56,19 +66,8 @@ module.exports = function(irc, network) {
user.away = away; user.away = away;
break; break;
default:
return;
} }
}
const msg = new Msg({
type: type,
text: away || "",
time: data.time,
from: user,
});
chan.pushMessage(client, msg);
}); });
} }
}; };