Merge pull request #2386 from thelounge/xpaw/quits-parts

Count quits as parts in condensed messages to reduce information density
This commit is contained in:
Jérémie Astori 2018-04-25 21:24:58 -04:00 committed by GitHub
commit 4ff5995617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -22,6 +22,11 @@ function updateText(condensed, addedTypes) {
const obj = getStoredTypes(condensed);
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];
condensed.data(type, obj[type]);
});
@ -45,9 +50,6 @@ function updateText(condensed, addedTypes) {
case "part":
strings.push(obj[type] + (obj[type] > 1 ? " users have left" : " user has left"));
break;
case "quit":
strings.push(obj[type] + (obj[type] > 1 ? " users have quit" : " user has quit"));
break;
case "nick":
strings.push(obj[type] + (obj[type] > 1 ? " users have changed nick" : " user has changed nick"));
break;