Skip to content

Commit

Permalink
Oh look, "continue" was useful for once
Browse files Browse the repository at this point in the history
  • Loading branch information
team1257Simon authored Jul 29, 2016
1 parent 13f5284 commit 2ea092b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -1903,12 +1903,15 @@ exports.commands = {
}
if (!targetUser) return this.errorReply("User '" + name + "' not found.");
if (!(targetUser.locked || (room.bannedUsers[toId(name)] && room.bannedIps[targetUser.latestIp]) || user.can('rangeban'))) return this.errorReply("User '" + name + "' is not banned from this room or locked.");
for (let i = 0; i < room.log.length; i++) {
let i = 0;
while(i < room.log.length) {
let message = room.log[i];
let split = message.split("|");
if (Users.get(split[3]) === this.targetUser || Users.get(split[3]).getAltUsers().indexOf(this.targetUser) >= 0) {
room.log.splice(i, 1);
continue;
}
i++;
}
this.addModCommand("" + targetUser.name + "'s messages were deleted from the log in room " + room.id + " by " + user.name + ".");
},
Expand Down

0 comments on commit 2ea092b

Please sign in to comment.