Commit Graph

170 Commits

Author SHA1 Message Date
Annika
88da40d046
Roomlog: Support getting total linecount (#7885) 2021-01-07 13:10:23 -08:00
Kris Johnson
7bb99e2abb
Add roomsettings for tournaments (#7876)
* Add roomsettings for tournaments

* gar ehseth et hseh

* aeth srth esg
2021-01-05 14:15:57 -08:00
Mia
6ca74b025f Chat: Properly sort filters by priority 2021-01-05 14:24:53 -06:00
Mia
40cc33fcfd
Chat: Add support for private pages (#7877) 2021-01-04 10:15:42 -08:00
Guangcong Luo
c44af3286d Implement Utils.forceWrap
I wrote a `forceWrap` method to support break-word wrapping in table
cells for scavengers, but apparently code blocks need it too, so I'm
moving it to Utils.

Fixes #7854
2020-12-30 17:41:41 -08:00
Annika
6d92ac8547
Repeats: Support non-time-based repeats (#7518) 2020-12-28 03:39:52 -08:00
Mia
f787625e2c
Translations: Properly ignore non-translation directories (#7826)
* Translations: Properly ignore non-translation directories

* use ids
2020-12-24 10:00:48 -08:00
SirKira(!Uzumaki)
542c28edd1
Allow PMing self with /blockpms on (#7811) 2020-12-21 03:47:24 -08:00
Annika
9a9b06ffc9
Chat: Support specifying priority for chatfilters (#7792) 2020-12-21 03:01:16 -08:00
Guangcong Luo
6ceaed0002 Fix TypeScript error
It seems every other week TypeScript does an update that affects
whether or not this line needs a cast.

This should probably have been refactored to `typeof` ages ago, because
that one way more reliably doesn't need a cast.
2020-12-12 19:44:54 +00:00
Mia
b7001afdba
Chat: Add a method for iterating commands (#7722) 2020-12-03 19:37:59 -08:00
Mia
62f358f1d0
Exclude room-specific commands for other rooms in /permissions (#7679) 2020-12-01 07:07:50 -08:00
Kris Johnson
fba68d5be6
Reformat old instances of CommandContext/Room#tr (#7744) 2020-12-01 06:31:55 -08:00
Mia
186677239d
Nicknamefilter: Support hiding nicks from filters (#7751) 2020-12-01 06:21:17 -08:00
Annika
2be851fed4
Chat: Remove unnecessary assertion
It looks like the type checker got smart enough to tell that `Array.isArray` ensures that it's a string. This should fix checks.
2020-11-19 19:54:12 -08:00
Mia
60bda2795f
CommandContext: Move parseCommand into Chat (#7661) 2020-11-11 19:59:38 -08:00
Guangcong Luo
ca5822c63c Set context.parse return value back to any
Sadly, there seems to be an issue with the `no-floating-promises`
linter. I'll revisit this later, but for now, this should fix the build
error.
2020-11-11 09:20:12 +00:00
Guangcong Luo
b9a0d3f494 Fix return signature of context.parse 2020-11-11 03:25:06 +00:00
Mia
b3f549cda2
Chat: Stop sending the message through when a command crashes (#7678) 2020-11-10 14:05:23 -08:00
Mia
850d4a4b9b
Add a command to disable commands (#7655) 2020-11-08 14:39:20 -08:00
Guangcong Luo
fc0e50e8f9 Fix bug in previous commit 2020-11-08 22:26:55 +00:00
Guangcong Luo
1e39e19f00 Refactor chat to use Utils.splitFirst 2020-11-08 18:31:38 +00:00
Guangcong Luo
e55cead3e4 Document context.parseCommand 2020-11-08 18:31:38 +00:00
Mia
71dbb2f466
Support Config.nothrottle (#7637) 2020-11-05 04:52:04 -08:00
Kris Johnson
acbe53ba4a
Modernize the coding style of the OM chat plugin (#7643) 2020-11-05 04:50:05 -08:00
Annika
56506c1801 Fix blocking room invites
When settings.blockInvites is false or undefined, we should allow room invites to be sent.
However, this code denies it because it thinks that the user sending the message is not of the rank "undefined" (or "false"), which isn't a real rank.
2020-11-04 21:37:57 -08:00
Mia
56501355d7
Support ignoring room invites (#7180) 2020-11-03 10:15:17 -08:00
Annika
7f2dec0797
Modlog: Avoid optional properties in ModlogEntry (#7613)
* Modlog: Avoid optional properties in ModlogEntry

* Use a type

* Make IP nullable

* Add NOT NULL constrains

* Fix typo
2020-11-01 14:07:01 -08:00
Guangcong Luo
db4963e49f Improve "click here" error message 2020-11-01 02:06:24 +00:00
Annika
58d8a2af70 Fix API for writing to the global modlog 2020-10-30 16:57:29 -07:00
Mia
6f721e31ff
CommandContext: Add a method for getting roomgames (#7531) 2020-10-28 05:20:33 -07:00
Annika
f2a4798bb8
Chatfilters: Fix reasons displaying as undefined (#7579) 2020-10-27 19:44:53 -07:00
Charlie Kobayashi
4272005e42
sendReplyBox: fix interaction with hidelines (#7577) 2020-10-27 19:32:03 -07:00
Mia
f1f6f21fc1
Connections: Track current chat page (#7522) 2020-10-26 14:43:16 -07:00
Guangcong Luo
e8451f8104 Clean up imports
A lot of our code for child processes doesn't really follow our
original standards. This refactors them back to work the way they
were intended to.
2020-10-24 22:12:35 +01:00
Kris Johnson
57e3d7c185
Add The Studio chat plugin (#7542) 2020-10-24 14:09:43 -07:00
Annika
97713bad33
Validate timeout durations (#7556) 2020-10-22 13:47:26 -07:00
Guangcong Luo
e98024f88f Fix bug in toDurationString precision
Fixes #7554
2020-10-21 19:04:06 -04:00
Guangcong Luo
d6eeb197c1 Improve Chat.toDurationString
- Default precision is now 3.

  (Instead of "3 months 25 days 17 hours 46 minutes 40 seconds", it'll
	say "3 months 25 days 17 hours". You can still set the precision to
	`Infinity` if you actually prefer that.)

- Now displays "forever" for Infinity or overflow durations

- No longer skips blank precision levels

  (Shows "3 hours 0 minutes 10 seconds" instead of
	"3 hours  10 seconds")
2020-10-21 13:05:08 +01:00
Mia
ef6cad7c9d
CommandContext: Make requireRoom support specifying a room (#7549) 2020-10-21 04:21:42 -07:00
Guangcong Luo
9d87616176
Add more style linting rules (#7537)
* Lint arrow-body-style

* Lint prefer-object-spread

Object spread is faster _and_ more readable.

This also fixes a few unnecessary object clones.

* Enable no-parameter-properties

This isn't currently used, but this makes clear that it shouldn't be.

* Refactor more Promises to async/await

* Remove unnecessary code from getDataMoveHTML etc

* Lint prefer-string-starts-ends-with

* Stop using no-undef

According to the typescript-eslint FAQ, this is redundant with
TypeScript, and they're not wrong. This will save us from needing to
specify globals in two different places which will be nice.
2020-10-19 02:42:28 -07:00
Guangcong Luo
0b0cf3733d Fix toTimestamp type signature 2020-10-13 04:40:38 -07:00
Annika
a285c2cf2c
Chat: Propagate promises for loading translations (#7496) 2020-10-09 13:15:50 -07:00
Annika
a3b83ba50b
Translations: Convert JSON to TypeScript (#7493) 2020-10-09 12:03:44 -07:00
Annika
2698153e7c
Quotes: Use readmore blocks for long quotes (#7465) 2020-10-07 11:28:39 -07:00
Leonard Craft III
789d892098
Chat#checkHTML: Ban <iframe> tags (#7476) 2020-10-06 11:16:04 -07:00
Quinton Lee
0094f34e38
Chat: fix CommandContext#filter in PMs
The ChatFilter type already specifies room as `Room | null` so this check should not be needed.
2020-10-04 13:22:57 -05:00
Annika
3fcb8f4e00
Use attributes of CommandContext in Chat.filter (#7461) 2020-10-03 21:30:20 -07:00
Guangcong Luo
523c1a335d
Introduce Chat.oldPlugins (#7434)
This provides a new way to persist chat plugin data across hotpatches:
`Chat.oldPlugins`.

In a plugin, you can now do:

```
export const cache = Chat.oldPlugins.pluginname?.cache || {};
```

to create a cache that will persist across hotpatches.
2020-09-30 19:45:54 -07:00
Annika
0877f0ae1e
Modlog: Fix entries with an IP address and no user (#7446) 2020-09-30 17:55:41 -07:00