Commit Graph

116 Commits

Author SHA1 Message Date
Mia
736e38e4af
ProcessManager: Handle Monitor#slow in subprocesses (#7990) 2021-03-03 12:39:53 -08:00
Mia
d50f5823ae Searchlogs: Properly handle deleted rooms 2021-02-26 13:52:25 -06:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -08:00
Mia
f4d78b8395
Fix build 2021-01-30 15:08:50 -06:00
Guangcong Luo
da30a71706 Revert "Remove User#inRooms and User#games (#7815)"
This reverts commit 5c9c84c415.

This also reverts commit 1fc92ef977.
2021-01-30 15:55:55 -05:00
Mia
0ad5c41896 Chatlog: Restrict access to slowlog roomlogs 2021-01-30 14:40:15 -06:00
Mia
5c9c84c415
Remove User#inRooms and User#games (#7815) 2021-01-28 10:41:35 -08:00
Mia
121e93524c
Add a command for searching groupchats (#7900)
* Add a command for searching groupchats

* OK
2021-01-11 01:27:59 -08:00
Mia
755f930957
Add a page/command for viewing log access logs (#7794) 2020-12-14 01:38:56 -08:00
Mia
94fe9d838b
Fix userid search regexes for battlesearch/chatlog (#7801) 2020-12-13 23:12:14 -08:00
Mia
ceb7bfab8b
Battlelog: Run search in PM (#7796) 2020-12-12 13:44:54 -08:00
Annika
37daf55014
Chatlog: Increase PM timeout to 1 hour 2020-12-11 20:47:09 -08:00
Mia
f9c4f8d4bc
Chatlog: Refactor FS/ripgrep handling and support battle logs (#7775) 2020-12-11 16:51:42 -08:00
Annika
da83a9bc37 Chatlog: Keep Upper Staff logs secret 2020-11-27 11:24:02 -08:00
Annika
7b9903bc8e
Chatlog: Support room aliases in /linecount (#7652) 2020-11-23 15:12:36 +04:00
Mia
0246147e94
Chatlog: Refactor perm checks for gstaff (#7649) 2020-11-11 19:54:17 -08:00
Guangcong Luo
b9a0d3f494 Fix return signature of context.parse 2020-11-11 03:25:06 +00:00
Mia
2cf1562541
Chatlog: Properly format search regexes in result rendering (#7674) 2020-11-10 14:25:12 -08:00
Konrad Borowski
7bcdf130bd
Chatlog: Escape regex when searching for an user (#7656) 2020-11-07 18:19:38 -08:00
Mia
950c74360b
Chatlog: Handle next result buttons properly (#7658) 2020-11-07 14:58:53 -08:00
Konrad Borowski
119b98b593
Chatlog: Automatically determine regex engine (#7657)
This makes ripgrep use PCRE2 for searching logs only when necessary.
2020-11-07 14:32:44 -08:00
Mia
8a1919fd0a Chatlog: Update arg handling 2020-11-04 14:24:53 -06:00
Mia
065be6ca78
Topusers: Fix arg handling (#7635) 2020-11-04 23:14:40 +04:00
Mia
89d127eafd
ProcessManager: Add a static execFile (#7566) 2020-11-02 11:35:07 -08:00
Mia
e2cb3a1f57
Chatlog: Support searching for a user (#7591) 2020-11-02 08:50:58 -08:00
Mia
458b47cb39
Chatlog: Allow non-trusted secret room ROs to view logs (#7597) 2020-10-29 06:48:55 -07:00
Mia
c67b745d44
Chatlog: Carry opts over when switching days (#7584) 2020-10-28 16:50:57 -07:00
Mia
2e864524e0
Chatlog: Use new username html tag (#7519) 2020-10-27 08:10:28 -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
Mia
5b387aed47
Chatlog: Support viewing log stats for a room (#7514) 2020-10-20 05:52:45 -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
Mia
a975f623a4
Chatlog: Add more opts (#7479) 2020-10-06 15:21:57 -07:00
Mia
fe5ef07f0c
Chatlog: Notify the user that a search is running (#7474) 2020-10-05 13:55:28 -07:00
Mia
ab16b48d48
Chatlog: Update permission checks (#7459) 2020-10-02 19:26:29 -07:00
Guangcong Luo
3d68248efa Update to latest eslint
We're skipping two major typescript-eslint versions, so there are a
bunch of changes here, including:

- it's catching a lot of things it didn't catch in the past, for
  reasons unclear to me

- no-unused-vars has to be explicitly disabled in global-types now

- a lot of `ts-ignore`s were never necessary and have been fixed

- Crashlogger can now handle being thrown things that aren't errors.
  This has never been a problem in the past, but to satisfy TypeScript
	we might as well not die in a fire on the off chance someone tries to
	`throw null` or something.
2020-09-29 15:28:08 -07:00
Mia
b7630b70cf
Chatlog: Handle ErrorMessage properly (#7438) 2020-09-29 14:30:50 -07:00
Guangcong Luo
9fe45238f5
Introduce chunk readers for ReadStream (#7215)
This adds new functions `stream.byChunk(bytes)`, `stream.byLine()` etc
which parse a `ReadStream` into an `ObjectReadStream<string>` which
can then be consumed with for-await.

Fixes #7195
2020-09-27 08:55:59 -07:00
Mia
7a89492947
Chatlog: Use ProcessManager for searches (#7393) 2020-09-22 18:23:01 -07:00
Mia
96b4c4c841
Searchlogs: Don't require a room (#7367) 2020-09-14 16:27:26 -07:00
Mia
44fc0123ad
Chat: Refactor CommandContext and PageContext to use ErrorMessage more (#7234) 2020-09-06 00:15:16 -07:00
Annika
08818294a8
Log viewer: Escape usernames (#7309) 2020-09-05 08:16:29 -07:00
Mia
6b671e9526
Searchlogs: Improve handling of date not found errors (#7308) 2020-09-03 17:52:20 -07:00
Mia
73e5284db3
Searchlogs: Fix crash in date parsing (#7307) 2020-09-03 17:24:47 -07:00
Mia
9a0f1ed11e
Fix regex replacing (#7265) 2020-08-31 06:19:04 -07:00
Annika
7f3e55deb9
Improve help message formatting for /searchlogs (#7136) 2020-08-05 23:47:08 -07:00
Mia
b9c9addfdb
Searchlog: Fix crash (#7121) 2020-08-02 16:35:07 -07:00
Mia
2a9015457d
Chatlog: Improve search (#6955) 2020-07-31 18:00:54 -07:00
Annika
05a9f9a1e5
Minor code quality improvements based on LGTM (#7092) 2020-07-30 14:24:37 -07:00
Annika
c5ebc2683c
Add a help message for /chatlog (#7063) 2020-07-25 21:32:26 -07:00
Annika
61e0a2e9e4
Chatlog: Fix grammar in error message (#6951) 2020-07-03 10:47:08 -07:00
Mia
6839a1f4db
Add a library for utility functions (#6817) 2020-06-09 22:06:43 -07:00
Mia
15fed24b40
Refactor auth and room.settings (#6777)
This implements two big changes:

- All settings shared between `room.chatRoomData` and `room` have been
  merged into `room.settings` (so, for instance, `room.slowchat` is now
  only `room.settings.slowchat`).

  This makes it so we never have to worry about them getting "out of
  sync".

  - Checking to see if a room is persistent is now `if (room.persist)`
    instead of `if (room.chatRoomData)`

  - `Rooms.global.writeChatRoomData()` is now rarely called directly;
    there's a new `room.saveSettings()` which will handle it for you.

  - All properties of `room.settings` are now optional (except
    `title`).

- There's a new file `user-groups.ts` which handles authority.

  - `room.auth` and `Users.globalAuth` are now
    `Auth extends Map<ID, GroupSymbol>` objects.

  - `room.auth` is now always defined, removing the need for
    `room.auth?.[userid]` workarounds.

  - A lot of code relating to usergroups and permission checks have
    been refactored.

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-06-09 08:22:25 -07:00
Annika
f4863a9444
Update references to Global Administrators post-flattening (#6815)
Co-authored-by: Charlie Kobayashi <sparkychildcharlie@gmail.com>
2020-06-08 09:41:03 -07:00
Mia
c09ecdb12b
Chatlog: Fix memory crashes, improve UI (#6750) 2020-05-27 21:47:50 -04:00
Mia
c246ae51b4
Support searching roomlog entries (#6494) 2020-05-25 18:22:51 -07:00
Guangcong Luo
0fa758bbea Hide uhtml from /chatlog by default
uhtmlchange messages, which should never have been in the chatlog
in the first place, are now always hidden.

uhtml messages are now hidden by default (can be shown with the `all`
option), because they lead to huge message sizes which cause problems
with the server, in gamecorner and a few other rooms which use it a
lot.
2020-05-18 17:04:42 -04:00
Peach
0ad24a0acd
Fix bugs in chatlog date parsing (#6550) 2020-04-09 22:47:12 -07:00
Peach
b812404669
Fix crash in roomlogs (#6546) 2020-04-09 01:32:56 -07:00
Guangcong Luo
86081c23ab Fix chatlog
- fix timezone
- `/chatlog [roomid]` should open logs for room
2020-04-07 21:47:56 -04:00
Guangcong Luo
604b8142ef Improve /chatlog support for uhtml 2020-03-23 17:50:15 -04:00
Guangcong Luo
64c3d75f1c Hide deleted rooms by default in chatlog 2020-03-16 03:35:32 -04:00
Guangcong Luo
c4e91d20e2 Improve chatlog design
Big thanks to smogon/pokemon-showdown-client@a176317913 for making
this possible!
2020-03-16 03:35:32 -04:00
Guangcong Luo
b7889f048f Fix chatlog permissions
- global auth should now be able to see chat logs of rooms they can't
  moderate

- secret and personal rooms that a staff member is either currently in,
  or has auth in, will now show up in the main logs list (although
  you should just use /chatlog, it's much easier)
2020-03-16 03:21:43 -04:00
Guangcong Luo
7de51956c5 Change BasicChatRoom to Room in some types
`user.can` and `user.authAtLeast` now take `Room | BasicChatRoom`
instead of `BasicChatRoom`. It's now significantly less necessary to
cast things to `BasicChatRoom`.
2020-03-15 19:52:59 -07:00
Guangcong Luo
99cf399860 Fix /chatlog command 2020-03-14 00:10:14 -04:00
Guangcong Luo
c6d83508ab Rename chat-log to chatlog to match modlog 2020-03-14 00:04:42 -04:00