Merge pull request #3494 from thelounge/xpaw/remove-away-chan

Remove away messages from channels
This commit is contained in:
Pavel Djundik 2019-11-05 12:43:43 +02:00 committed by GitHub
commit 901d96c8cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 32 deletions

View file

@ -55,22 +55,6 @@ export default {
constants.condensedTypes.forEach((type) => {
if (obj[type]) {
switch (type) {
case "away":
strings.push(
obj[type] +
(obj[type] > 1
? " users have gone away"
: " user has gone away")
);
break;
case "back":
strings.push(
obj[type] +
(obj[type] > 1
? " users have come back"
: " user has come back")
);
break;
case "chghost":
strings.push(
obj[type] +

View file

@ -19,7 +19,7 @@ const colorCodeMap = [
["15", "Light Grey"],
];
const condensedTypes = ["away", "back", "chghost", "join", "part", "quit", "nick", "kick", "mode"];
const condensedTypes = ["chghost", "join", "part", "quit", "nick", "kick", "mode"];
const condensedTypesQuery = "." + condensedTypes.join(", .");
const timeFormats = {

View file

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