pokemon-showdown
pokemon-showdown copied to clipboard
Add offline messaging
Few things of note here. FIrstly, as I was concerned about database load, all PMs are temporary. When user A sends a PM to user B while offline, the PM is retained for 60 days (assuming the user has not seen it). After that, it is deleted. When a user logs in, their pending PMs are sent to them, and they are all marked as seen (set to the current UNIX timestamp). The user may replay these PMs via a chat page for up to one week, after which they are deleted. I have also presently unified the /blockpms command with the setting (stored in the database) that marks if a user wants to receive offline pms (and from what rank, if so). This can be forcibly set via Config.usesqlitepms, which indicates the rank that users must be to send offline PMs. If either the config setting or the user setting is set to friends, only friended users may send that user offline PMs. Note that with the offline blockpms we currently do not support 'autoconfirmed' and 'unlocked' settings. Locked users should be blocked by default, though. Closes #2151.
The user may replay these PMs via a chat page for up to one week, after which they are deleted.
Since we retain PMs for moderation purposes anyway, is there a reason we can't let them replay them indefinitely? I'm fairly sure SQLite WAL mode allows for concurrent reading and writing of the database. If this is some private thing feel free to move this to the Dev discord.
Bump?