Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /hidealtstext command #3750

Merged
merged 1 commit into from
Jul 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions chat-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,9 @@ exports.commands = {
},
unnamelockhelp: ["/unnamelock [username] - Unnamelocks the user. Requires: % @ * & ~"],

hidetext: function (target, room, user) {
hidetextalts: 'hidetext',
hidealtstext: 'hidetext',
hidetext: function (target, room, user, connection, cmd) {
if (!target) return this.parse('/help hidetext');

this.splitTarget(target);
Expand All @@ -2203,11 +2205,22 @@ exports.commands = {
return this.errorReply("User '" + name + "' is not banned from this room or locked.");
}

this.addModCommand("" + targetUser.name + "'s messages were cleared from " + room.title + " by " + user.name + ".");
this.add('|unlink|' + hidetype + userid);
if (userid !== toId(this.inputUsername)) this.add('|unlink|' + hidetype + toId(this.inputUsername));
if (cmd === 'hidealtstext' || cmd === 'hidetextalts') {
this.addModCommand(`${targetUser.name}'s alts' messages were cleared from ${room.title} by ${user.name}.`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make this only appear to staff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has to add something besides the |unlink|hide| messages to the room in order for them to appear to new users joining the room though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm

this.add(`|unlink|${hidetype}${userid}`);
for (let i in targetUser.prevNames) {
this.add(`|unlink|${hidetype}${targetUser.prevNames[i]}`);
}
} else {
this.addModCommand("" + targetUser.name + "'s messages were cleared from " + room.title + " by " + user.name + ".");
this.add('|unlink|' + hidetype + userid);
if (userid !== toId(this.inputUsername)) this.add('|unlink|' + hidetype + toId(this.inputUsername));
}
},
hidetexthelp: ["/hidetext [username] - Removes a locked or banned user's messages from chat (includes users banned from the room). Requires: % (global only), @ * # & ~"],
hidetexthelp: [
"/hidetext [username] - Removes a locked or banned user's messages from chat (includes users banned from the room). Requires: % (global only), @ * # & ~",
"/hidealtstext OR /hidetextalts [username] - Removes a locked or banned user's messages, and their alternate account's messages from the chat (includes users banned from the room). Requires: % (global only), @ * # & ~",
],

ab: 'blacklist',
blacklist: function (target, room, user) {
Expand Down