Commit Graph

38 Commits

Author SHA1 Message Date
Mia
7b22cf96ba Roomfaqs: Escape newlines out of HTML faqs 2021-12-09 10:44:29 -06:00
Guangcong Luo
fb8a370cfb Fix incorrect command in /viewfaq
Fixes #8555
2021-12-06 12:28:21 -05:00
Mia
48aaec0cd3 Roomfaqs: Allow people with the addfaq permission to view sources
the 'rfaq' perm is inconsistent: /addfaq perms make more sense and are what we check for the source in the page.
2021-11-11 10:51:16 -06:00
Kris Johnson
11bf7b38a9 Room FAQs: Allow multiline with HTML FAQs 2021-09-06 17:07:09 -06:00
Kris Johnson
8151ffca2a Room FAQs: Fix source code and repeats display 2021-09-06 17:01:23 -06:00
Kris Johnson
62eaf3f5fa Room FAQs: Update help 2021-06-28 17:08:16 -06:00
Mia
7cad87035f Roomfaqs: Actually fix crash 2021-06-22 23:20:57 -05:00
Mia
342ce89a38 Roomfaqs: Fix crash 2021-06-22 23:19:57 -05:00
Mia
e02b358da5
Room FAQs: Support HTML (#8343) 2021-06-22 18:26:31 -07:00
Mia
7ae21cebf8
Chat: Support exporting custom handlers from plugins (#8319) 2021-05-28 23:13:01 -07:00
Guangcong Luo
810aff74cd Namespace more server global types 2021-04-25 14:16:27 -07:00
Guangcong Luo
486f292904
Refactor everything to use Utils.sortBy (#8220)
A few uses of `array.sort()` have been left alone:

- sorting in `data/` because they aren't supposed to import anything

- `set-importer` because I still have no clue what that's for and what
  dependencies it is/isn't allowed to have

- `sort()` with no arguments used as a lexical sort (at which point
  `sortBy` offers no benefits)

All other cases have been replaced with `Utils.sortBy`, which should
be a massive increase in readability.

Sort orders should be much more readable now, without needing to puzzle
through sign issues. The order is always low-to-high, A-to-Z,
true-to-false.
2021-04-23 22:41:00 -07:00
Mia
b7680c783d
Add infrastructure to rename chat plugin data with rooms (#8153) 2021-04-01 01:23:01 -04:00
Annika
11b7245c99 Room FAQs: Don't allow empty FAQ entries 2021-02-22 14:56:50 -08:00
Kris Johnson
82b20aaf8e
Use /msgroom in more places (#8042) 2021-02-16 20:10:05 -08:00
Kris Johnson
f347f4d4f2 Room FAQs: Fix grammar 2021-02-11 14:31:58 -07:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -08:00
Mia
a63fb0074a
CommandContext: Add a method for refreshing html pages (#7666) 2021-01-28 12:10:50 -08:00
Distrib
fecfc9f846
Room FAQs: Display raw text in /rfaq (#7928) 2021-01-23 04:37:44 -08:00
Annika
62f1bd14fc Chat plugins: Make viewing source respect /permissions 2020-10-28 16:59: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
Kris Johnson
d9b3a510ad
TextFormatter: Support replacing \n without trusted (#7507) 2020-10-11 13:38:34 -07:00
Kris Johnson
b107236dc5
Repeats: Refactor storing and deleting repeats, let people repeat room FAQs (#7488) 2020-10-07 23:42:30 -07:00
Mia
62bcce1d55 Plugins: Don't try-catch ENOENT errors when using FS.readIfExists() 2020-09-26 23:02:45 -05:00
Kris Johnson
5a8ded0568
Room FAQs: Convert the rfaq list to a page (#7394) 2020-09-22 19:30:05 -07:00
Mia
44fc0123ad
Chat: Refactor CommandContext and PageContext to use ErrorMessage more (#7234) 2020-09-06 00:15:16 -07:00
Mia
d8ecdb5f83
Help: Only write state when relevant to the room (#7207) 2020-08-18 13:06:52 -07:00
Mia
647d5af76f
Add a filter for auto-answering questions in the Help room (#7100) 2020-08-05 23:44:46 -07:00
Lusamine
3a2ca90040
Minor cleanup of global demotion messages (#7011) 2020-07-17 01:17:36 -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
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
b21c9047e2
Migrate to typescript-eslint (#6342) 2020-03-05 08:33:06 -08:00
Kris Johnson
e64e083e6c
Typescript The Cafe (#6379) 2020-02-20 23:01:20 -08:00
HoeenHero
3dcc7d21cc Handle empty/non-existant files when loading 2020-02-19 21:18:10 -05:00
HoeenHero
65bb9635c2 Fix importing of various chat-plugin's data 2020-02-19 21:03:30 -05:00
Kris Johnson
2ea84725e2
Typescript Daily Spotlight, RoomFAQs, and Wi-Fi (#6373) 2020-02-18 13:26:44 -08:00