Commit Graph

61 Commits

Author SHA1 Message Date
HoeenHero
7ed5db54b4 Battlesearch: Refactor to only search one day (#4763) 2018-07-22 13:17:42 +09:00
HoeenHero
a9530d8641 Battlesearch: Only search the current month 2018-06-15 12:04:49 -04:00
HoeenHero
96500fa96c Refactor /battlesearch (#4673) 2018-05-16 16:25:45 -05:00
asgdf
3c0ce53dd1 Modlog: Avoid duplicate entries in /modlog all (#4563) 2018-04-09 18:18:03 -05:00
asgdf
76f966fa72 Modlog: Fix matches at end of line (#4564) 2018-04-09 01:59:00 -05:00
HoeenHero
bcaaa12cab Add /battlesearch (#4517) 2018-03-26 08:35:19 -05:00
Aurolux
cc63f90244 Alias /modlog with /ml (#4489) 2018-03-17 12:38:53 +09:00
Guangcong Luo
de3e0e11c7 Change Chat.count argument order
This is purely a readability change; behind the scenes there's now more
magic going on, but magic is good for text processing functions, which
are otherwise way too verbose.
2018-03-05 21:19:37 +09:00
Guangcong Luo
cad1165ad4 Implement Chat.count
Adds some more magic to make Chat.plural more readable when used to
count things.

Overall, it's not _nearly_ as concise as I'd like, but it might be the
best we can get for now.
2018-03-05 20:57:25 +09:00
Guangcong Luo
9fdc3ad828 Don't spin up useless regexes in /modlog 2018-02-14 02:29:20 +09:00
Guangcong Luo
879d0a0e12 Fix FileReadStream
It hasn't been kept up to date for various stream API changes. This fix
makes it work properly again.
2018-02-14 02:29:20 +09:00
Guangcong Luo
da55a7b443 Fix crash on large modlogs 2018-02-13 23:02:18 +09:00
Marty-D
878060795f
Update modlog permission check 2018-01-27 22:12:46 +00:00
Guangcong Luo
66269d8e96 Fix Modlog maxLines passing 2018-01-18 20:39:44 -06:00
Guangcong Luo
8132ab5981 Use PM.isParentProcess to detect parent/child process 2018-01-18 04:24:49 -06:00
Guangcong Luo
6ae6a8daf2 Remove debug code 2018-01-18 03:45:41 -06:00
Guangcong Luo
ab1f995daa Rewrite Process Manager
Process Manager is now lib/process-manager.js

It's been entirely rewritten to reflect what I think a process manager
API should look like.

In particular, there are now two Process Managers, QueryProcessManager
and StreamProcessManager.

Pass QueryProcessManager a pure-ish query function (sync or async) that
takes a JSON value and returns a JSON value, and PM.query() will
execute that function in a subprocess, and return a Promise for its
return value.

StreamProcessManager is the same idea: Pass it a function to create an
ObjectReadWriteStream, and PM.createStream() will create a stream in a
subprocess and return a stream connected to it.
2018-01-18 03:34:16 -06:00
Guangcong Luo
8f3bed7e59 Make fsPath.read() return a string by default
This is an update to match how Streams work: .read() returns a string,
and .readBuffer() returns a Buffer.

Being able to statically predict what type .read() will return is
really useful to TypeScript, in addition to being generally useful for
readability.

As a side benefit, readTextIfExists() is renamed readIfExists().
2018-01-18 03:31:13 -06:00
Charlie Kobayashi
331af4e794 Refactor Modlog Formatting (#3972) 2018-01-08 15:18:24 -06:00
Kris Johnson
a6ce5c9dc1 Refactor chat-plugins and formats to for...of (#4288) 2017-12-28 05:22:28 -06:00
Jeremy Piemonte
e0c08eafba Standardize help commands (#4285) 2017-12-27 19:35:32 -06:00
HoeenHero
227f7b4741 Modlog: Fix search all rooms (#4266) 2017-12-19 15:13:56 -06:00
Guangcong Luo
193e948592 Move crashlogger.js -> lib/crashlogger.js 2017-12-16 15:40:45 -06:00
Guangcong Luo
738c60ed8b Move repl.js -> lib/repl.js 2017-12-16 15:40:45 -06:00
Guangcong Luo
a9540917f5 Move fs.js -> lib/fs.js 2017-12-16 15:40:45 -06:00
Guangcong Luo
c63e57f2e9 Defer joining restricted HTML rooms until login
This makes it so staff-only HTML rooms can defer rendering until the
user has logged in.

This also introduces a new constant `Rooms.RETRY_AFTER_LOGIN` which
makes it clearer what returning `null` means in context.
2017-12-13 23:33:33 -06:00
Guangcong Luo
32673acb59 Improve modlog link API 2017-12-12 04:26:11 -05:00
Guangcong Luo
c8ad406de5 Use new HTML-room system for Modlog 2017-12-12 03:22:09 -06:00
Guangcong Luo
800dbadd53 Use new HTML-room API for modlog 2017-11-23 05:25:14 -06:00
asgdf
a25da567ad Modlog: fix result count display being off by one (#4044) 2017-10-07 16:20:00 -05:00
Ben Davies
48230ee8fc Modlog: cap search queries at 2500 characters (#4011)
Prevents crashes in the modlog child process when PS is configured not
to use ripgrep.
2017-09-23 01:37:16 -05:00
asgdf
1ef2c6ba94 Modlog: Fix user search for usernames containing certain non-alphanum characters (#3919) 2017-08-26 12:59:16 -07:00
asgdf
b0e3ced5cc Modlog: fix various small issues (#3853)
* Don't show "More..." button if the amount of results is already less than the max
* Properly pass on whether an exact search was performed to the prettifying function
* Improve phrasing in reaction to whether an exact search was performed
* Allow "More..." button to do a literal modlog query instead of always doing a username search
* Reorder some lines pertaining to the line count so they're not needlessly scattered all over the place
2017-08-07 03:46:41 -05:00
panpawn
5a2dba75e8 Modlog: Don't hardcode LINES_SEPARATOR length (#3849) 2017-07-31 16:19:25 -04:00
panpawn
236c65aeca Modlog: Fix typo in help command (#3845) 2017-07-29 15:46:50 -04:00
panpawn
048ee759ff Modlog: Refactor line specification (#3820)
Before, if you wanted to specify how many results you wanted from a modlog search:
1. You could not search for any text
2. It was capped at 100 results

Now, we drop support for the old means of specifying lines, and instead we have a "More results..." button in modlog's UI.

We also support an undocumented means of specifying lines in the form of: /modlog [roomid], [search] [lines=integer], where integer is the number of lines of results you would like to see.
NOTE: We purposely are not documenting this behavior, as it is mostly made use of in the UI

We also update the help command here to reflect these changes.
2017-07-28 14:32:28 -04:00
panpawn
f724b355f4 Modlog: Enable command in private messages (#3817)
When dealing with reports, especially when in single panel mode, this can be useful
2017-07-22 14:00:44 -07:00
Guangcong Luo
6c40884426 Make modlog non-modal 2017-07-20 12:50:41 -05:00
HoeenHero
341648c8ea Modlog: Use a popup for no results (#3807) 2017-07-20 11:22:03 -05:00
panpawn
daf6a95fd9 Modlog: Use connection.send for sending popup (#3797) 2017-07-17 18:47:34 -05:00
HoeenHero
49d569f85f Modlog: Fix modal issue (#3796) 2017-07-17 16:55:19 -05:00
panpawn
5ae05456d9 Modlog: Make popup modal (#3783)
This will prevent the classic waiting for modlog and accidentally clicking it away
2017-07-15 06:03:39 -05:00
CheeseMuffin
69128a0205 Modlog: Fix double message in groupchats (#3749) 2017-07-10 17:00:45 +09:00
asgdf
30c766af2a Fix /modlog all (#3731) 2017-07-06 16:45:38 +09:00
Ben Davies
d09ce242a8 Modlog: crash log uncaught exceptions (#3733) 2017-07-06 15:20:14 +09:00
Guangcong Luo
ab7bd2d4e7 Fix modlog 2017-07-03 00:17:04 +09:00
Guangcong Luo
95e8bebeaf Revert "ProcessManager: refactor, fix memory leak, use Typescript (#3706)"
This reverts commit c9b93d3529.
2017-07-02 08:11:18 -04:00
Ben Davies
c9b93d3529 ProcessManager: refactor, fix memory leak, use Typescript (#3706)
- spawning and setting up child processes is now handled by
ProcessManager#constructor rather than needing to be done manually for
each module that uses ProcessManager
- direct references to ProcessManager in ProcessWrapper were removed to
prevent dead ProcessWrapper instances from being leaked when hotpatching
- process-manager.js and verifier.js now use Typescript
2017-06-30 09:09:13 +09:00
Konrad Borowski
380aced69b Use FS module for modlog (#3691) 2017-06-28 15:36:41 +08:00
asgdf
17b41a39d8 Fix crash in /modlog public (#3693) 2017-06-27 17:24:20 -07:00