pokemon-showdown/server/chat-plugins
dot-Comfey 8fb16faf70
Improvements to room FAQs and repeats (#9270)
* Improvements to room FAQs and repeats

- Removed /rfaq alias check when setting a topic to repeat. If a /rfaq alias is set to repeat, the text of the topic the alias is set for is displayed, rather than the topic's ID.
- If a /rfaq is deleted, repeats linked to it or one of its aliases will also be deleted, preventing a crash caused by trying to display a nonexistent topic.
- A separate problem, but the ability to set a topic as an alias of itself has been removed. Because this is possible, you can have a topic which is registered in the server, but does not appear at all if you type /rfaq.

* Remove unnecessary toID

* Update room-faqs.ts

Avoiding lint error array-callback-return

* Use for loop instead of map

* Update room-faqs.ts

* Restore original code, prevent overriding topics

Turns out it is possible to cause a similar crash that is not related to repeats. This can be done by creating two topics (Topic 1 and Topic 2) and making Topic 2 have an alias (Topic 3). You can then make Topic 2 an alias of Topic 1, making Topic 3 an alias of an alias. Deleting Topic 1 will delete Topic 2 but not Topic 3, and typing /rfaq Topic 3 will cause a crash.

It feels like it would overcomplicate the code to try to redirect existing aliases. I don't know how often people override topics, but the removal of this does not seem like too much of an inconvenience (just one extra step to convert a topic to an alias).

Also, for some reason, removing an alias would remove a repeat linked to the topic. Not sure why it was made that way, so I made it so that removing the topic is the only thing that should remove the repeat.
2023-10-22 18:28:33 -05:00
..
randombattles Revamp [Gen 5] Random Battle (#9822) 2023-10-06 19:58:51 -06:00
trivia Fix CI 2023-05-25 11:28:36 -07:00
abuse-monitor.ts Add /am edithistory to /help am (#9581) 2023-06-02 11:54:22 -07:00
announcements.ts Namespace more server global types 2021-04-25 14:16:27 -07:00
battlesearch.ts Migrate to esbuild for compilation (#9203) 2022-12-22 15:19:29 -06:00
blackjack.ts RoomGame: Refactor to use generic typing (#8678) 2022-03-13 18:01:54 -07:00
calculator.ts Handle new TypeScript version (#8449) 2021-08-30 20:11:44 -07:00
cg-teams-leveling.ts CGT: Track winrates per-forme (#9339) 2023-03-29 20:56:11 -07:00
chat-monitor.ts Filters: Update help for /filter test 2023-09-28 14:35:33 -05:00
chatlog.ts Linecount: Fix displaying total lines for user pages (#9791) 2023-09-20 16:01:11 -05:00
COMMANDS.md Add a bit more documentation for plines 2021-04-28 01:53:03 -07:00
daily-spotlight.ts Spotlights: Fix "Refresh" button opening another tab (#8684) 2022-03-10 15:59:39 -08:00
datasearch.ts Hide Ogerpon-Mask-Tera formes from searches (#9813) 2023-10-04 11:16:56 -06:00
friends.ts Friends: Allow users to toggle /blockpms friends etc. in settings (#9265) 2023-01-03 17:31:18 -06:00
github.ts Git reporting: Add pokemon-showdown-loginserver to reported repos 2023-03-26 14:23:55 -05:00
hangman.ts Hangman: Prevent impossible guesses, escape HTML (#9033) 2022-11-23 12:50:09 -08:00
helptickets-auto.ts Auto-helptickets: Refactor pmharassment/battleharassment reasons 2022-02-28 15:03:21 -06:00
helptickets.ts Helptickets: Add aliases to ensure /ticketban and /unticketban work 2023-07-10 22:40:18 -05:00
hosts.ts Fix addhosts grammar 2023-01-14 14:22:17 -06:00
jeopardy.ts Jeopardy: Escape HTML in question (#9150) 2022-12-09 18:49:15 -06:00
lottery.ts Namespace more server global types 2021-04-25 14:16:27 -07:00
mafia.ts Mafia: Prevent incorrect alignment. (#9368) 2023-01-28 19:33:52 -05:00
modlog-viewer.ts Chatlog: Support linking to specific times in chat 2022-12-16 08:03:17 -06:00
othermetas.ts Mix and Mega: Add support for Masks 2023-09-15 11:41:31 -06:00
permalocks.ts Permalocks: Ensure icons are saved 2023-09-17 22:49:10 -05:00
poll.ts Polls: Allow escaping separators (#9074) 2022-12-09 17:49:47 -08:00
quotes.ts Quotes: Increase quote cap to 300 2022-04-04 15:05:44 -05:00
repeats.ts Extend /repeat multiline pattern for all commands (#8593) 2021-12-29 21:18:57 -08:00
responder.ts Handle new TypeScript version (#8449) 2021-08-30 20:11:44 -07:00
rock-paper-scissors.tsx RPS: Add pause game button 2022-11-26 22:11:14 -06:00
room-events.ts Roomevents: Check /roomevents add permissions for viewing source 2021-05-20 09:36:11 -05:00
room-faqs.ts Improvements to room FAQs and repeats (#9270) 2023-10-22 18:28:33 -05:00
sample-teams.ts Sample Teams: Fix aliases & checking whitelist (#8943) 2022-10-26 20:31:30 -04:00
scavenger-games.ts Scavengers: Update the Minesweeper twist description (#9483) 2023-05-16 19:42:27 -05:00
scavengers.ts Scavengers: Add the Minesweeper twist (#9462) 2023-03-29 20:53:51 -07:00
smogtours.ts Smogtours: Require accredation on images 2023-09-18 22:58:37 -05:00
suspect-tests.ts /suspects: Add alias 2023-03-12 16:09:42 -06:00
tcgtabletop.ts Namespace more server global types 2021-04-25 14:16:27 -07:00
teams.ts Teams: Sort search results by date 2023-10-21 14:37:22 -05:00
the-studio.ts The Studio: Add a shared help entry for recommendation commands 2022-06-26 21:35:39 -05:00
thecafe.tsx Support JSX in HTML pages (#8523) 2021-11-12 22:06:26 -08:00
thing-of-the-day.ts Thing-of-the-Day: Ensure custom keys can be updated in /-otd set 2022-12-13 11:07:34 -06:00
uno.ts Allow Uno player to see hand and color selection (#9329) 2023-03-29 21:01:27 -07:00
username-prefixes.ts Prefix-Manager: Update help 2022-11-06 13:17:30 -06:00
usersearch.tsx Usersearch: Convert to TSX (#8641) 2022-02-15 17:19:17 -08:00
wifi.tsx Add Gen 9 (#8997) 2022-11-17 20:46:29 -05:00
youtube.ts Fix button title 2023-04-05 19:44:28 -05:00