Commit Graph

221 Commits

Author SHA1 Message Date
Mia
d992b8f5fa
Add more support for custom punishments (#8215) 2021-04-23 22:40:31 -07:00
Leonard Craft III
d1e863b584
Help Tickets: Add cheating report type (#8190) 2021-04-10 01:14:04 -07:00
Mia
46dc3409b6
Helptickets: Notify users of /faq proxy when opening an IP-appeal ticket (#8132) 2021-04-02 22:29:14 -04:00
Mia
b21def4e91
Help tickets: Refresh /ht list on ticket update (#8113) 2021-03-22 15:55:58 -07:00
Mia
a15268f9c1 Helptickets: Remove extraneous 'month' from staff stats page 2021-03-22 13:31:42 -05:00
Mia
c4b23e790d
Helptickets: Automatically save replays linked in tickets (#8120) 2021-03-18 00:21:21 -07:00
Mia
523f572bec Helptickets: Handle gbanned namelocked users properly 2021-03-15 16:24:42 -05:00
Mia
5dd0da602d
Help tickets: Refresh ticket list in 'more tickets' button on click (#8080) 2021-02-28 18:41:21 -08:00
Annika
c2e97aaaed
Use optional chaining in more places (#8063) 2021-02-22 11:42:05 -08:00
Volco
99cb8ea055
Fix helptickets game.ticket setting to undefined (#8000) 2021-02-13 23:18:40 -05:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -08: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
1654307731
Helptickets: Fix bugs with unbanning (#7883) 2021-01-28 11:43:44 -08:00
Mia
5c9c84c415
Remove User#inRooms and User#games (#7815) 2021-01-28 10:41:35 -08:00
Leonard Craft III
40731a74e8
Improve help ticket roomintro CSS (#7915) 2021-01-14 20:21:47 +04:00
Mia
6ae859326d Helptickets: Update the #hostfilter lock page description 2021-01-09 20:29:28 -06:00
Mia
ca94dea20f
FS: Fix hotpatching and add more throttling (#7878)
- `writeUpdate` state is now stored in a global variable, so hotpatching doesn't crash it
- throttling now writes on the tail (so two throttled `writeUpdate` calls will write one update, not two)
- room settings, punishments, and helptickets are now throttled
2021-01-09 15:49:30 -08:00
Annika
90645c1cad Helptickets: Fix typo 2020-11-20 17:32:13 -08:00
Mia
f4d89b2d54
Helptickets: Mark tickets with offline users separately (#7708) 2020-11-19 04:59:44 -08:00
Mia
c6f72a9e85
/sharedbattles: Upload replays of shared battles (#7682) 2020-11-11 17:23:24 -08:00
Guangcong Luo
b9a0d3f494 Fix return signature of context.parse 2020-11-11 03:25:06 +00:00
Mia
20e7ee4556
Helptickets: Use globalModAction for /ht ban (#7664) 2020-11-10 16:18:45 +04:00
Annika
fceffa6635 Helptickets: Export tickets for easier debugging 2020-11-08 21:03:44 -08:00
Mia
fc80f47b0b
Helptickets: Fix ticketban list html (#7636) 2020-11-07 19:14:08 -08:00
Annika
0a27f398df
Helptickets: Display message in unclaimed tickets (#7647) 2020-11-05 11:09:47 -08:00
Annika
ee79159a25 Helptickets: Don't make global modlog entries 2020-11-02 21:58:46 -08:00
Annika
1ab6091551 Helptickets: Properly quote and escape button HTML 2020-10-29 19:30:06 -07:00
Mia
6f22b27e15
Ticketbans: Use the user object (#7596) 2020-10-29 08:11:47 -07:00
Annika
b226a501b3
Helptickets: Add button for the reporter's modlog (#7560)
As per (this suggestion)[https://www.smogon.com/forums/threads/staff-suggestions-bugs.3514540/page-17#post-8634198].
2020-10-28 11:41:12 -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
Annika
fe034ac087
Helptickets: Don't show battles for self-reports (#7520) 2020-10-19 00:57:38 -07:00
Annika
018105bd10 Helptickets: Escape HTML in common battles 2020-10-14 08:52:52 -07:00
Annika
ea9170b062
Helptickets: Display common battles in more ticket types (#7510) 2020-10-11 13:27:23 -07:00
Annika
a3b83ba50b
Translations: Convert JSON to TypeScript (#7493) 2020-10-09 12:03:44 -07:00
Annika
7eabc7635c
Remove trailing whitespace
I thought I had set up my editor to do this but apparently not.... my bad.
2020-10-05 09:20:22 -07:00
Annika
dc77ad160a
Helptickets: Display common battles more cleanly 2020-10-05 09:06:52 -07:00
Annika
d807e00e40
Helptickets: Display shared battles in staffintro (#7460) 2020-10-02 19:24:29 -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
f1b4e3d43a
Modlog: Refactor to use ModlogEntry objects (#7403) 2020-09-28 11:06:30 -07:00
Mia
f7288df665 Fix build 2020-09-26 23:27:51 -05:00
Mia
62bcce1d55 Plugins: Don't try-catch ENOENT errors when using FS.readIfExists() 2020-09-26 23:02:45 -05:00
Annika
2e6ed8a50f
Helptickets: Fix double notification (#7415)
We should only be sending notifications through Staff room rather than the page.
2020-09-25 00:17:14 +04:00
Annika
eb2261b846
Helptickets: Close a user's ticket on global ban (#7411) 2020-09-22 21:00:38 -07:00
Annika
ba4bb2f120
Helptickets: Display user language and remove prefix (#7373) 2020-09-16 01:21:07 -07:00
Mia
041d8fb0ed
Helptickets: Refactor bans to use the punishment interface (#7365) 2020-09-14 17:02:57 -07:00
Mia
23f0c6be74
Helpticket list: Respect ignoring tickets (#7345) 2020-09-10 17:26:31 -07:00
Annika
0a26579afa
Make core commands translatable (#7279) 2020-09-06 17:49:53 -07:00
Mia
44fc0123ad
Chat: Refactor CommandContext and PageContext to use ErrorMessage more (#7234) 2020-09-06 00:15:16 -07:00
Annika
c9fa3fc389
Refactor User#prevNames and User#ips to arrays (#7267) 2020-08-29 10:27:03 -07:00
Annika
44d369ca8a
Allow users to set their own language and translate helptickets (#7220) 2020-08-19 00:21:51 -07:00
Annika
4318d7c9bc
Fix modlog formatting (#7173) 2020-08-07 11:17:34 -07:00
Annika
f563252418
Modlog: Fix bugs and support hotpatching (#7163) 2020-08-06 22:05:13 -04:00
Annika
92552da849
Helptickets: Always respect ignoreTickets (#7144) 2020-08-04 01:32:39 -07:00
Peach
d87eeb4e2c
Don't modnote twice on joining a helpticket (#7049) 2020-07-29 00:17:24 -07:00
Annika
7248e6f87c
Helptickets: Fix grammar and add text about appealing locks (#7055) 2020-07-24 15:59:58 -07:00
Guangcong Luo
2f805c93a2
Remove "Battle" prefix from data exports (#7039)
`BattlePokedex` is now `Pokedex`, `BattleItems` is now `Items`, etc.

I also renamed `Movedex` to `Moves` and `Statuses` to `Conditions`.

`TypeChart` isn't `Types` yet, because unlike the others, it's not
indexed by ID. That should probably be fixed one day.
2020-07-24 12:42:26 -07:00
Lusamine
3a2ca90040
Minor cleanup of global demotion messages (#7011) 2020-07-17 01:17:36 -07:00
Kirk Scheibelhut
eea2196280
Server side changes to support persistent user settings and privacy changes (#6947)
NOTE: This is changes the semantics of `hidenext`/`ionext` from
applying to the next created *battle* to applying to the next
created *search*/*challenge*.
2020-07-06 21:18:38 -07:00
Mia
4997a47314
Commands: Allow the room parameter to be null (#6948)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-07-05 14:25:09 -07:00
Kirk Scheibelhut
bbfcd7ae25 Remove 'inappropriate status' from reports
Staff suggest this is never used for the correct reasons and is more
trouble than its worth
2020-07-04 18:14:10 -07:00
Guangcong Luo
6af875af8b Improve RoomPermission/GlobalPermission checks
Global permissions can no longer be used as room permissions. Instead,
the two are entirely separate lists, with only a few permissions in
both lists.
2020-06-21 03:53:06 -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
Guangcong Luo
d34f4f23f5 Suppress crash while hotpatching helptickets
I think this was just due to a different helpticket crash, but sadly I didn't really have the free
time to investigate more deeply.
2020-04-07 21:47:56 -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
125fe31d06 Improve eslintrc
Fixed some more code style, allowing these rules to be enabled:

- `comma-dangle`
- `function-paren-newline`
- `member-delimiter-style`
- `no-eval`
- `no-fallthrough`
- `no-misused-promises`
- `no-unused-vars`
- `operator-linebreak`
2020-03-06 22:35:55 -08:00
Waleed Hassan
8aa4f053bb
Use optional chaining and linter improvements (#6422)
This is mostly just a follow up to #6342.

`prefer-optional-chaining` was turned on and fixed in every location it
complained in. The transformed function [0] looks expensive from a
glance but from skimming through the replaced sites it doesn't appear
to be ran in any important place, so it should be OK.

The linter improvements are:
- Increase linter performance
	- Make `full-lint` and `lint` write to different caches so we
	  avoid overwriting their caches since they're different configs
	- Change husky's hook to `npm run lint` so as to write to the
	  same cache
	- Remove `@typescript-eslint/eslint-plugin-tslint` which is
	  essentially a wrapper to TSLint because the rules aren't worth
	  running another linter
- Convert `.eslintrc.json` and `.eslintrc-syntax.json` to two spaces
  rather than four tabs to respect PS' `.editorconfig`
- Rename `fulllint` to `full-lint` to ease spelling it

[0] - https://pastie.io/mmtxpf.js (prettified)
2020-03-06 11:44:32 -08:00
Guangcong Luo
b21c9047e2
Migrate to typescript-eslint (#6342) 2020-03-05 08:33:06 -08:00
whales
926970f765
Automatically upload replays when reporting (#6380) 2020-02-21 00:47:19 -08:00
Kris Johnson
9aaab2c57b
Typescript Help Tickets and Modlog and fix warnings (#6352) 2020-02-12 21:48:03 -08:00