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

Refactor lastAttackedBy to hurtBy #4832

Closed
wants to merge 126 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
1cdb859
Update pokemon.js
bgsamm Aug 27, 2018
aa6a463
Refactor lastAttackedBy to hurtBy (#1)
bgsamm Aug 28, 2018
f2eb42d
Update pokemon.js
bgsamm Aug 28, 2018
1f457ab
Fix typo in Battle.nextTurn
bgsamm Aug 28, 2018
c062277
Corrections
bgsamm Aug 28, 2018
3394968
Change == to ===
bgsamm Aug 28, 2018
3d0c98e
Fix wrong attribute name
bgsamm Aug 28, 2018
eefea85
Update @type for hurtBy
bgsamm Aug 28, 2018
5cd0e07
Random Battle: Fix Flyinium Z appearing with other Z Crystals (#4834)
ascriptmaster Aug 28, 2018
87a1542
Update Phantom/Shadow Force interaction with Minimize
Marty-D Aug 28, 2018
952e5f9
AAA: Ban Zygarde
TheImmortal Aug 29, 2018
101f169
Add Battle Spot Special 12 (#4835)
LegoFigure11 Aug 29, 2018
b97365f
Restore Mirror Move's short description (#4836)
urkerab Aug 29, 2018
87064b0
Update threads for VGC
TheImmortal Aug 30, 2018
1bc1e15
Trivia: Update levenshtein function (#4720)
CheeseMuffin Sep 1, 2018
2c15a16
BrightPowder -> Bright Powder
Zarel Sep 1, 2018
bc23b3f
2v2: Add Sleep Clause
TheImmortal Sep 1, 2018
55f27d8
Gen 6 Random Battle: Update crash message
TheImmortal Sep 1, 2018
0a10b30
Add Accuracy Moves Clause
TheImmortal Sep 1, 2018
5813add
Add September RoA Spotlight, LCotM, and OMotM (#4838)
KrisXV Sep 1, 2018
02521f3
Update OM rotational ladder
TheImmortal Sep 1, 2018
3933cf5
Fix past gen Pursuit knockouts on the switch
Marty-D Sep 1, 2018
8936b8c
Gen II: Fix Snubbull event moves
Marty-D Sep 1, 2018
be94b72
Fix typo in gen61v1 desc (#4839)
FeluciaPS Sep 1, 2018
e5dcb1f
TypeScript UNO (#4825)
KrisXV Sep 1, 2018
c7ec922
Support staff-only HTML boxes (#4840)
sirDonovan Sep 2, 2018
61be747
Uno: Improve Typescript
HoeenCoder Sep 2, 2018
ce8dd99
Learnsets: Lotad can't learn Dive
Marty-D Sep 2, 2018
8d582a4
Add new event Pokemon
Marty-D Sep 2, 2018
9623a19
Update PU
TheImmortal Sep 3, 2018
733ea72
Make a move fail if the target is the user and it's not self-target
Marty-D Sep 3, 2018
058a1ee
Event sort (#4833)
Sep 3, 2018
91c0301
1v1: Ban Snorlax
TheImmortal Sep 3, 2018
a96e804
Improve Sim README
Zarel Sep 4, 2018
0f2d590
Update SIM README MOVESLOTSPEC table
Zarel Sep 4, 2018
16faa75
CAP: Add Mumbao and update prevos
Marty-D Sep 4, 2018
ae52683
Fix uhtmlchange Roomlogs function
Zarel Sep 6, 2018
9c87d65
Refactor /coverage
Zarel Sep 6, 2018
eb28444
Fix /learn
Zarel Sep 6, 2018
ae03a15
Fix misc bugs discovered by LGTM
Zarel Sep 6, 2018
50c2413
Random Battle: Update Empoleon (#4844)
ascriptmaster Sep 6, 2018
74ab9ba
UNO: Fix crash on DQing player with uno
iscke Sep 8, 2018
c494ac3
"Fix" the second turn of called multi-turn moves
Marty-D Sep 8, 2018
dfd08e6
Add more information to /help blacklist
HoeenCoder Sep 8, 2018
7b58e11
Uno: Don't delete properties
HoeenCoder Sep 8, 2018
d154a85
Update UU VR thread
TheImmortal Sep 8, 2018
2395816
Include dance move flag in /dt and /ms (#4847)
asgdf Sep 9, 2018
550ec66
Allow /dt to find CAPmons by their dex number (#4848)
asgdf Sep 9, 2018
b7aa41a
Fix /coverage with type arguments (#4849)
asgdf Sep 10, 2018
6c6c898
2v2: Ban Z-Crystals
TheImmortal Sep 10, 2018
f4e2b4f
September tier shifts
TheImmortal Sep 10, 2018
fb0f401
Mafia: Support cohosts, resetting roles (#4837)
iscke Sep 11, 2018
c206315
Mafia: Update help & bug fixes
HoeenCoder Sep 12, 2018
2a25f4e
Battle Factory: Update Ubers (#4851)
KrisXV Sep 12, 2018
f46e0fc
Remove user's text from scrollback log (#4751)
iscke Sep 13, 2018
952ccb2
Correct Soul-Heart activation order
Marty-D Sep 13, 2018
b4b2f1e
Fix Laser Focus
Marty-D Sep 13, 2018
54c32e3
Datacenters: Update outdated range
HoeenCoder Sep 14, 2018
5989f95
Clarify that banwords are room-specific
Sep 14, 2018
faf0444
Clarify Mind Blown description
Marty-D Sep 15, 2018
aae3fad
Datacenters: Update ranges (#4857)
asgdf Sep 15, 2018
142172a
Support roomauth-only HTML boxes (#4855)
sirDonovan Sep 15, 2018
a02e924
Mafia: Fix bug with subs (#4856)
iscke Sep 16, 2018
12f26b8
Sketchmons: Restrict Extreme Speed (#4859)
KrisXV Sep 16, 2018
76e486f
Fix Conversion 2
Marty-D Sep 16, 2018
03492bd
Fix *html permissions in help (#4860)
iscke Sep 16, 2018
e0167ef
Add a chat monitor plugin (#4755)
Sep 18, 2018
50324e5
Fix typo in Sim Readme
Zarel Sep 18, 2018
bcefeb2
Fix other typo in Sim Readme
Zarel Sep 18, 2018
b09ea1d
Chat monitor: fix typo
Asheviere Sep 18, 2018
d97a8ac
Chat monitor: namespace filter commands
Asheviere Sep 18, 2018
08d960e
Chat monitor: improve stat tracking
Asheviere Sep 18, 2018
e448e31
Chat monitor: also list reason when using autolock words in staff
Asheviere Sep 18, 2018
8a1b59c
Chat monitor: Move /viewfilters to HTML panel
Zarel Sep 18, 2018
0edfea3
Improve modlog
Zarel Sep 18, 2018
a0440a8
Chat monitor: also display allowed names on the filter list and move …
Asheviere Sep 18, 2018
c1d047e
Allow word boundaries in name filters
Asheviere Sep 18, 2018
334af1a
Chat monitor: do not bypass filters in groupchats ending in 'staff'
Asheviere Sep 18, 2018
4037d22
Chat monitor: fix wordfilter
Asheviere Sep 18, 2018
54b6ba4
Chat monitor: trim reason
Asheviere Sep 18, 2018
bfa0d84
Chat monitor: add alias for /filter view
Asheviere Sep 18, 2018
8a9ce5d
Chat monitor: add help command
Asheviere Sep 18, 2018
373e3dc
Chat monitor: Label ids in /filter view
Asheviere Sep 18, 2018
9e93c4c
Add basic language support (#4862)
HoeenCoder Sep 18, 2018
fe2097d
Reduce Emergency Exit's rating
TheImmortal Sep 18, 2018
cf24fab
Gen 5: Random Battle improvements
TheImmortal Sep 18, 2018
d9bd8bd
Rules: Fix crash when used in PMs (#4863)
panpawn Sep 18, 2018
ddbdedd
Chat monitor: make word filters case insensitive
Asheviere Sep 19, 2018
2c98aca
Chat monitor: fix saving wordfilters
Asheviere Sep 19, 2018
29ca700
Chat monitor: also fix removing wordfilters
Asheviere Sep 19, 2018
1df5c26
Chat monitor: one final failure
Asheviere Sep 19, 2018
a0c9213
Fix double Sky Drop message (#4864)
Sep 19, 2018
fac9e36
Chat monitor: use message to parse wordfilter regex to avoid failing …
Asheviere Sep 19, 2018
e3fc3e7
Chat monitor: exclude staff PMs and help rooms from filters
Asheviere Sep 19, 2018
3d8d314
Chat monitor: Allow filtered words in the staff room
Asheviere Sep 19, 2018
14ac21d
Chat monitor: Keep case the same when filtering words
Asheviere Sep 19, 2018
8a1e494
Chat monitor: move check for !filterTo up to avoid a crash
Asheviere Sep 19, 2018
2def752
Random Battle: Add Z-Move Mimikyu
TheImmortal Sep 19, 2018
70ef2a4
Chat monitor: fix a very unfortunate mistake
Asheviere Sep 20, 2018
0818b1c
Random Battle: Various improvements
TheImmortal Sep 20, 2018
0212424
Scavengers: Incognito + filter improvements (#4824)
Sep 20, 2018
5dae4b1
Chat monitor: Make /filter view more flexible
Asheviere Sep 20, 2018
83be94a
Mafia: Fix sub bug, update permissions (#4865)
iscke Sep 20, 2018
6024c4a
Add new event Pokemon
Marty-D Sep 21, 2018
2a7ffcb
Allow namechanges that don't change the userid anytime
HoeenCoder Sep 21, 2018
41f404e
Fix minor unused variable
Zarel Sep 20, 2018
6007583
Implement Illusion Level Mod
Zarel Sep 21, 2018
79152f3
Fix bugs in /analysis
HoeenCoder Sep 21, 2018
7432d3f
Fix set gen/format /learn (#4868)
iscke Sep 22, 2018
49c1e3f
Add /notifyrank (#4858)
sirDonovan Sep 23, 2018
5ef9857
Random Battle: Fix Arceus
TheImmortal Sep 24, 2018
48e0e87
Random Battle: Fix Torterra (#4870)
ascriptmaster Sep 24, 2018
5df0a02
Revert "Implement Illusion Level Mod"
TheImmortal Sep 24, 2018
d80c813
Update Random Battle
TheImmortal Sep 24, 2018
8e4f837
Gen VI-VII: Update breaking protection
Marty-D Sep 24, 2018
f77d8d6
Fix a constructor bug with room languages (#4871)
iscke Sep 24, 2018
df1b799
Slowchat: Don't announce when the setting changes
HoeenCoder Sep 24, 2018
5590035
Rules: Update grammar for Hindi
HoeenCoder Sep 24, 2018
bd969af
Chat monitor: Add some aliases (#4872)
panpawn Sep 25, 2018
63ad355
Modlog: Don't include main account in list of alts (#4873)
asgdf Sep 25, 2018
2accf99
Introduce /unlockname and redesign /unlockip (#4869)
Sep 25, 2018
0ffdde5
Add help for the new /unlock commands
Asheviere Sep 25, 2018
868db27
BW OU: Ban Arena Trap, Unban Dugtrio (#4874)
KrisXV Sep 28, 2018
84fbbe0
Fix user popup for locked alts in /ip (#4875)
asgdf Sep 28, 2018
b2c92de
Merge branch 'refactor-lastattackedby' of https://github.com/bgsamm/P…
bgsamm Sep 29, 2018
a7e3a23
Added lastHurtBy getter
bgsamm Oct 8, 2018
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
151 changes: 107 additions & 44 deletions chat-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,7 @@ const commands = {
let roomid = target.trim();
if (!roomid) {
// allow deleting personal rooms without typing out the room name
if (room.isPersonal && cmd === "deletegroupchat") {
roomid = room.id;
} else {
if (!room.isPersonal || cmd !== "deletegroupchat") {
return this.parse(`/help deleteroom`);
}
} else {
Expand Down Expand Up @@ -1063,7 +1061,7 @@ const commands = {
}
if (!this.can('declare')) return false;
if (target.length > 80) return this.errorReply(`Error: Room description is too long (must be at most 80 characters).`);
let normalizedTarget = ' ' + target.toLowerCase().replace('[^a-zA-Z0-9]+', ' ').trim() + ' ';
let normalizedTarget = ' ' + target.toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim() + ' ';

if (normalizedTarget.includes(' welcome ')) {
return this.errorReply(`Error: Room description must not contain the word "welcome".`);
Expand Down Expand Up @@ -1263,6 +1261,7 @@ const commands = {
}
if (!target) return this.parse('/help roomowner');
target = this.splitTarget(target, true);
if (target) return this.errorReply(`This command does not support specifying a reason.`);
let targetUser = this.targetUser;
let name = this.targetUsername;
let userid = toId(name);
Expand Down Expand Up @@ -1551,8 +1550,7 @@ const commands = {
this.privateModAction(displayMessage);
}
}
this.add(`|unlink|hide|${userid}`);
if (userid !== toId(this.inputUsername)) this.add(`|unlink|hide|${toId(this.inputUsername)}`);
room.hideText([userid, toId(this.inputUsername)]);

if (room.isPrivate !== true && room.chatRoomData) {
this.globalModlog("ROOMBAN", targetUser, ` by ${user.userid} ${(target ? `: ${target}` : ``)}`);
Expand Down Expand Up @@ -1737,6 +1735,7 @@ const commands = {
unmute: function (target, room, user) {
if (!target) return this.parse('/help unmute');
target = this.splitTarget(target);
if (target) return this.errorReply(`This command does not support specifying a reason.`);
if (!this.canTalk()) return;
if (!this.can('mute', null, room)) return false;

Expand Down Expand Up @@ -1860,8 +1859,7 @@ const commands = {
displayMessage = `(${name}'s ac account: ${acAccount})`;
this.privateModAction(displayMessage);
}
this.add(`|unlink|hide|${userid}`);
if (userid !== toId(this.inputUsername)) this.add(`|unlink|hide|${toId(this.inputUsername)}`);
room.hideText([userid, toId(this.inputUsername)]);

const globalReason = (target ? `: ${userReason} ${proof}` : '');
this.globalModlog((week ? "WEEKLOCK" : "LOCK"), targetUser || userid, ` by ${user.userid}${globalReason}`);
Expand Down Expand Up @@ -1904,7 +1902,58 @@ const commands = {
this.errorReply(`User '${target}' is not locked.`);
}
},
unlockhelp: [`/unlock [username] - Unlocks the user. Requires: % @ * & ~`],
unlockname: function (target, room, user) {
if (!target) return this.parse('/help unlock');
if (!this.can('lock')) return false;

const userid = toId(target);
const punishment = Punishments.userids.get(userid);
if (!punishment) return this.errorReply("This name isn't locked.");
if (punishment[1] === userid) return this.errorReply(`"${userid}" was specifically locked by a staff member (check the global modlog). Use /unlock if you really want to unlock this name.`);

Punishments.userids.delete(userid);
Punishments.savePunishments();

for (const curUser of Users.findUsers([userid], [])) {
if (curUser.locked && !curUser.locked.startsWith('#') && !Punishments.getPunishType(curUser.userid)) {
curUser.locked = false;
curUser.namelocked = false;
curUser.updateIdentity();
}
}
this.globalModlog("UNLOCKNAME", userid, ` by ${user.name}`);
this.addModAction(`The name '${target}' was unlocked by ${user.name}.`);
},
unlockip: function (target, room, user) {
target = target.trim();
if (!target) return this.parse('/help unlock');
if (!this.can('ban')) return false;
const range = target.charAt(target.length - 1) === '*';
if (range && !this.can('rangeban')) return false;

if (!/^[0-9.*]+$/.test(target)) return this.errorReply("Please enter a valid IP address.");

const punishment = Punishments.ips.get(target);
if (!punishment) return this.errorReply(`${target} is not a locked/banned IP or IP range.`);

Punishments.ips.delete(target);
Punishments.savePunishments();

for (const curUser of Users.findUsers([], [target])) {
if (curUser.locked && !curUser.locked.startsWith('#') && !Punishments.getPunishType(curUser.userid)) {
curUser.locked = false;
curUser.namelocked = false;
curUser.updateIdentity();
}
}
this.globalModlog(`UNLOCK${range ? 'RANGE' : 'IP'}`, target, ` by ${user.name}`);
this.addModAction(`${user.name} unlocked the ${range ? "IP range" : "IP"}: ${target}`);
},
unlockhelp: [
`/unlock [username] - Unlocks the user. Requires: % @ * & ~`,
`/unlockname [username] - Unlocks a punished alt while leaving the original punishment intact. Requires: % @ * & ~`,
`/unlockip [ip] - Unlocks a punished ip while leaving the original punishment intact. Requires: @ * & ~`,
],

forceglobalban: 'globalban',
gban: 'globalban',
Expand Down Expand Up @@ -1982,8 +2031,7 @@ const commands = {
this.privateModAction(displayMessage);
}

this.add(`|unlink|hide|${userid}`);
if (userid !== toId(this.inputUsername)) this.add(`|unlink|hide|${toId(this.inputUsername)}`);
room.hideText([userid, toId(this.inputUsername)]);

const globalReason = (target ? `: ${userReason} ${proof}` : '');
this.globalModlog("BAN", targetUser, ` by ${user.userid}${globalReason}`);
Expand Down Expand Up @@ -2126,19 +2174,6 @@ const commands = {

unrangelock: 'unlockip',
rangeunlock: 'unlockip',
unlockip: function (target, room, user) {
target = target.trim();
if (!target) {
return this.parse('/help unbanip');
}
if (!this.can('rangeban')) return false;
if (!Punishments.ips.has(target)) {
return this.errorReply(`${target} is not a locked/banned IP or IP range.`);
}
Punishments.ips.delete(target);
this.addModAction(`${user.name} unlocked the ${(target.charAt(target.length - 1) === '*' ? "IP range" : "IP")}: ${target}`);
this.modlog('UNRANGELOCK', null, target);
},

/*********************************************************
* Moderating: Other
Expand Down Expand Up @@ -2224,6 +2259,7 @@ const commands = {
if (!this.can('promote')) return;

target = this.splitTarget(target, true);
if (target) return this.errorReply(`This command does not support specifying a reason.`);
let targetUser = this.targetUser;
let userid = toId(this.targetUsername);
let name = targetUser ? targetUser.name : this.targetUsername;
Expand Down Expand Up @@ -2358,6 +2394,32 @@ const commands = {
},
announcehelp: [`/announce OR /wall [message] - Makes an announcement. Requires: % @ * # & ~`],

notifyoffrank: 'notifyrank',
notifyrank: function (target, room, user, connection, cmd) {
if (!target) return this.parse(`/help notifyrank`);
if (!this.can('addhtml', null, room)) return false;
if (!this.canTalk()) return;
let [rank, notification] = this.splitOne(target);
if (!(rank in Config.groups)) return this.errorReply(`Group '${rank}' does not exist.`);
const id = `${room.id}-rank-${Config.groups[rank].id}`;
if (cmd === 'notifyoffrank') {
room.sendRankedUsers(`|tempnotifyoff|${id}`, rank);
} else {
let [title, message] = this.splitOne(notification);
if (!title) title = `${room.title} ${Config.groups[rank].name}+ message!`;
if (!user.can('addhtml')) {
title += ` (notification from ${user.name})`;
}
if (message.length > 300) return this.errorReply(`Notifications should not exceed 300 characters.`);
room.sendRankedUsers(`|tempnotify|${id}|${title}|${message}`, rank);
this.modlog(`NOTIFYRANK`, null, target);
}
},
notifyrankhelp: [
`/notifyrank [rank], [title], [message] - Sends a notification to everyone with the specified rank or higher. Requires: # * & ~`,
`/notifyoffrank [rank] - Closes the notification previously sent with /notifyrank [rank]. Requires: # * & ~`,
],

fr: 'forcerename',
forcerename: function (target, room, user) {
if (!target) return this.parse('/help forcerename');
Expand All @@ -2379,6 +2441,7 @@ const commands = {
Ladders.cancelSearches(targetUser);
targetUser.resetName(true);
targetUser.send(`|nametaken||${user.name} considers your name inappropriate${(reason ? `: ${reason}` : ".")}`);
targetUser.trackRename = targetUser.name;
return true;
},
forcerenamehelp: [`/forcerename OR /fr [username], [reason] - Forcibly change a user's name and shows them the [reason]. Requires: % @ * & ~`],
Expand Down Expand Up @@ -2454,20 +2517,18 @@ const commands = {
if (!(user.can('lock') || localPunished)) return this.errorReply(`User ${name} is neither locked nor muted/banned from this room.`);

if (targetUser && (cmd === 'hidealtstext' || cmd === 'hidetextalts' || cmd === 'hidealttext')) {
this.addModAction(`${name}'s alts' messages were cleared from ${room.title} by ${user.name}.`);
room.sendByUser(user, `${name}'s alts messages were cleared from ${room.title} by ${user.name}.`);

this.modlog('HIDEALTSTEXT', targetUser, null, {noip: 1});
this.add(`|unlink|hide|${userid}`);
const alts = targetUser.getAltUsers(true);
for (const alt of alts) {
this.add(`|unlink|hide|${alt.getLastId()}`);
}
for (const prevName in targetUser.prevNames) {
this.add(`|unlink|hide|${targetUser.prevNames[prevName]}`);
}
room.hideText([
userid,
...Object.keys(targetUser.prevNames),
...targetUser.getAltUsers(true).map(user => user.getLastId()),
]);
} else {
this.addModAction(`${name}'s messages were cleared from ${room.title} by ${user.name}.`);
room.sendByUser(user, `${name}'s messages were cleared from ${room.title} by ${user.name}.`);
this.modlog('HIDETEXT', targetUser || userid, null, {noip: 1, noalts: 1});
this.add(`|unlink|hide|${userid}`);
room.hideText([userid]);
}
},
hidetexthelp: [
Expand Down Expand Up @@ -2540,7 +2601,12 @@ const commands = {
}
return true;
},
blacklisthelp: [`/blacklist [username], [reason] - Blacklists the user from the room you are in for a year. Requires: # & ~`],
blacklisthelp: [
`/blacklist [username], [reason] - Blacklists the user from the room you are in for a year. Requires: # & ~`,
`/unblacklist [username] - Unblacklists the user from the room you are in. Requires: # & ~`,
`/showblacklist OR /showbl - show a list of blacklisted users in the room. Requires: % @ # & ~`,
`/expiringblacklists OR /expiringbls - show a list of blacklisted users from the room whose blacklists are expiring in 3 months or less. Requires: % @ # & ~`,
],

battleban: function (target, room, user, connection) {
if (!target) return this.parse(`/help battleban`);
Expand Down Expand Up @@ -3290,7 +3356,7 @@ const commands = {
// errors can occur while rebasing or popping the stash; make sure to recover
try {
this.sendReply(`Rebasing...`);
[code, stdout, stderr] = await exec(`git rebase FETCH_HEAD`);
[code] = await exec(`git rebase FETCH_HEAD`);
if (code) {
// conflict while rebasing
await exec(`git rebase --abort`);
Expand All @@ -3299,7 +3365,7 @@ const commands = {

if (stashedChanges) {
this.sendReply(`Restoring saved changes...`);
[code, stdout, stderr] = await exec(`git stash pop`);
[code] = await exec(`git stash pop`);
if (code) {
// conflict while popping stash
await exec(`git reset HEAD .`);
Expand Down Expand Up @@ -3802,12 +3868,8 @@ const commands = {
let targetUser = Users.getExact(target);
if (!targetUser) return this.errorReply(`User '${target}' not found.`);

target = targetUser ? targetUser.userid : '';

if (target) {
room.battle.win(targetUser);
this.modlog('FORCEWIN', target);
}
room.battle.win(targetUser);
this.modlog('FORCEWIN', targetUser.userid);
},
forcewinhelp: [
`/forcetie - Forces the current match to end in a tie. Requires: & ~`,
Expand Down Expand Up @@ -3901,6 +3963,7 @@ const commands = {
'!accept': true,
accept: function (target, room, user, connection) {
target = this.splitTarget(target);
if (target) return this.popupReply(`This command does not support specifying multiple users`);
const targetUser = this.targetUser || this.pmTarget;
if (!targetUser) return this.popupReply(`User "${this.targetUsername}" not found.`);
Ladders.acceptChallenge(connection, targetUser);
Expand Down
2 changes: 1 addition & 1 deletion chat-formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class TextFormatter {

// filter links first
str = str.replace(linkRegex, uri => {
let fulluri = uri;
let fulluri;
if (/^[a-z0-9.]+@/ig.test(uri)) {
fulluri = 'mailto:' + uri;
} else {
Expand Down
Loading