Merge pull request #3494 from thelounge/xpaw/remove-away-chan
Remove away messages from channels
This commit is contained in:
commit
901d96c8cc
@ -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] +
|
||||
|
@ -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 = {
|
||||
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user