Count quits as parts in condensed messages to reduce information density

See https://github.com/thelounge/thelounge/pull/2383#discussion_r183915328 for discussion
This commit is contained in:
Pavel Djundik 2018-04-25 18:18:11 +03:00 committed by Jérémie Astori
parent d202eaa267
commit bf2a80a7b5
No known key found for this signature in database
GPG Key ID: B9A4F245CD67BDE8

View File

@ -22,6 +22,11 @@ function updateText(condensed, addedTypes) {
const obj = getStoredTypes(condensed); const obj = getStoredTypes(condensed);
Object.keys(addedTypes).map((type) => { Object.keys(addedTypes).map((type) => {
// Count quits as parts in condensed messages to reduce information density
if (type === "quit") {
type = "part";
}
obj[type] += addedTypes[type]; obj[type] += addedTypes[type];
condensed.data(type, obj[type]); condensed.data(type, obj[type]);
}); });
@ -45,9 +50,6 @@ function updateText(condensed, addedTypes) {
case "part": case "part":
strings.push(obj[type] + (obj[type] > 1 ? " users have left the channel" : " user has left the channel")); strings.push(obj[type] + (obj[type] > 1 ? " users have left the channel" : " user has left the channel"));
break; break;
case "quit":
strings.push(obj[type] + (obj[type] > 1 ? " users have quit" : " user has quit"));
break;
case "nick": case "nick":
strings.push(obj[type] + (obj[type] > 1 ? " users have changed nick" : " user has changed nick")); strings.push(obj[type] + (obj[type] > 1 ? " users have changed nick" : " user has changed nick"));
break; break;