The old /updateserver used the equivalent of
git pull --rebase
(if that fails)
git stash && git pull --rebase && git stash pop
The new /updateserver works on
git fetch && git rebase --autostash FETCH_HEAD
Which is a lot simpler and should in theory be more resilient to merge
conflicts while stashing.
This unifies modjoin checks (both Room#modjoin and Room#staffRoom join
restrictions) under one function, Room#checkModjoin.
This makes it easier for commands to check whether a user should know
about a room's existence, which, previously, had been duplicated
unreliably in each command's implementation.
Fixes#2426
PMs no longer special-case commands. The implementation of /invite,
/me, etc in commands have been fully moved from messages.js back to
commands.js and the rest. This makes Messages command support a lot
closer to how CommandParser itself handles commands; the two files
should be mergeable soon.
/me has been refactored, and now supports /ME, /me's, etc in PMs and
regular chat exactly the same way.
context.pmTarget is now guaranteed to be `User|undefined`, rather than
its previous specification of `User|string|undefined`. The previous
use-case of putting a string in context.pmTarget was to support
errorReply when PMing a nonexistent user, but special-casing that
case is easier than having to support a possible string pmTarget
everywhere.
Aliases like /j used to not work when called from the global room while not in
lobby.
Using rest parameters for TestPattern#register instead of a
single array came out to be faster.
/roomtopic also isn't a command.
These changes were supposed to be in de524c1a26 but got lost in my
Git stash...
Once again, this is very experimental code; please don't base any
serious changes on it.
- /ip would display "undefined" for rooms a user isn't banned/muted in
- CrisisMonitor would report private roombans/blacklists
- Roombans/blacklists would alert for rooms you're not in
- There were crashes in /mute and /hidetext
Roombans/blacklists have been mostly rewritten from scratch.
The new code mostly uses the same patterns as global punishments.
In addition:
- /ban has been renamed /globalban
- globalbans and blacklists now require a reason
- bans and blacklists in public rooms now show up in global modlog
- blacklist syntax is different: /blacklist and /unblacklist
- ban/blacklist display in /whoare is now more detailed
This isn't all the work that needs to be done on blacklists, but it's
the highest-priority changes.
- blacklists.tsv has been renamed room-punishments.tsv
- The format everywhere has changed to roomid:userid, rather than
roomid|userid
- roompunishments.tsv's format is now `Room ID:User ID, IPs and alts`
rather than `User ID, Room ID|IPs and alts`, which is more sane and
also cuts down on repetition of room IDs
Those are the changes that affect storage format, which are highest
priority because I don't want to support the previous format.
Other changes include:
- Punishments.roombannedIps renamed to Punishments.roomIps
- Punishments.roombannedUserids renamed to Punishments.roomUserids
- Some refactoring for ES6 destructuring
- Various bugfixes
The /adddatacenters command should probably not be used by most people,
but here is some documentation if you insist.
It takes a list of datacenters in CSV format and adds them to
config/datacenters.csv
The advantage over doing it yourself is that it preserves the sort
order and warns for intersections. For most intersections, the correct
response is to let it pass, but if your range is too wide, you should
remove the too-narrow ones and retry.
Room setting commands, including /modchat and also /capsfilter, are now
set in chat-plugins/roomsettings.js.
/capitals has been renamed /capsfilter
/stretching has been renamed /stretchfilter
The /roomsettings UI has been redesigned.
Global drivers (that is, anyone with the global modlog permission) now
have access to modlogs in private rooms.
Global drivers and up can use modlog all to get access to private room
modlogs anyway, so this makes it more consistent.
This commit introduces Tools.html and Tools.plural, helper functions
for string construction.
Tools.html is a template tag function that escapes HTML inside the
template string.
Tools.plural is a helper function that takes a passed Number, Array,
Set, or Map and returns a string representing whether or not it's
plural.
It also starts doing some refactors of some files to make it clear how
I expect code style for template strings to look.
Previously, we used ' for IDs, " for English text, and ' for code.
We should now be using ' for IDs, ` for English text, and ` for code.
User#games, previously a null-prototype roomid:game Object,
is now User#games, a roomid:game Map.
It would have been refactored into a roomid Set, but I'm afraid of
inconsistent state, even more so than I am of the corresponding
problem in Connection#inRooms. TODO: that.
This also fixes the handling of the race condition where a ladder
battle starts after a user starts a name change but before the name
change finishes.
Now, the battle is force-forfeited. Perhaps the ladder battle
should be prevented if the user changes name...
Connection#rooms, previously a null-prototype roomid:room Object,
is now Connection#inRooms, a roomid Set.
This, incidentally, makes it stop retaining rooms, which may make the
GC's job easier and may also lead to unexpected bugs if we get
inconsistent state (we often do get inconsistent state, so look
forward to that!)
The rename is mostly to put it in line with the new User#inRooms,
and for ease of greppability without running into Rooms.rooms.