Cockatrice/servatrice/src
SwitchOCE 7709184ecc
[Server] Let users fetch their own private chat history (#7506)
* [Server] Let users fetch their own private chat history

Players lose their private conversations on reconnect or on another
device. Servatrice can already log private messages, but only
moderators can read the logs.

Add Command_GetPrivateChatHistory / Response_PrivateChatHistory so a
registered user can page through their own logged conversation with one
other user. Operators opt in with logging/allow_user_chat_history
(default off, and log_user_msg_chat must be on). The caller is matched
by account id so reused guest or deleted-account names can't read older
messages; only time, sender name and text are returned. Pages hold
1..200 messages and never split a second, since log_time has 1-second
resolution.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [Server] Harden private chat history identity matching

Match both participants by account id and name so a federated user's remote id cannot collide with a local account, and stop storing foreign ids in the local chat log. Extract the paging assembly into a pure helper and cover the whole-second boundary rules with gtests.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Lukas Brübach <44814898+BruebachL@users.noreply.github.com>
2026-11-09 13:21:43 +01:00
..
smtp [SMTP] Add reliable email delivery with retry and database-backed queue (#7240) 2026-10-11 20:59:32 +02:00
deck_tag_serialization.h [Server] Add deck share links and public deck visibility (#7241) 2026-09-20 20:22:16 +02:00
email_parser.cpp [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
email_parser.h Fix #4903: Parse Email Addresses whenever used (#4932) 2023-12-09 00:52:47 -05:00
event_loop_watchdog.cpp [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
event_loop_watchdog.h [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
forwarded_address.cpp [Server] Parse the rightmost address from forwarded header lists (#7586) 2026-10-18 16:53:55 -04:00
forwarded_address.h [Server] Parse the rightmost address from forwarded header lists (#7586) 2026-10-18 16:53:55 -04:00
isl_interface.cpp [Servatrice] Use compile-time checked connections (#7631) 2026-11-02 07:13:21 +01:00
isl_interface.h [Servatrice] Relay room channel messages over ISL (#7480) 2026-10-16 22:46:40 +02:00
main.cpp [Servatrice] Fail loudly when startup initialization fails (#7602) 2026-10-31 19:02:49 +01:00
main.h Refactor servatrice email send 2015-07-25 18:48:34 +02:00
metrics_registry.cpp [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
metrics_registry.h [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
private_chat_paging.cpp [Server] Let users fetch their own private chat history (#7506) 2026-11-09 13:21:43 +01:00
private_chat_paging.h [Server] Let users fetch their own private chat history (#7506) 2026-11-09 13:21:43 +01:00
ratelimiter.cpp [Server] Inform client of login/registration rate limit timeout (#7468) 2026-10-16 05:47:43 +02:00
ratelimiter.h [Server] Inform client of login/registration rate limit timeout (#7468) 2026-10-16 05:47:43 +02:00
servatrice.cpp [Servatrice] Use compile-time checked connections (#7631) 2026-11-02 07:13:21 +01:00
servatrice.h [Servatrice] Match trusted_sources by address, not substring (#7582) 2026-10-18 16:50:04 -04:00
servatrice_connection_pool.cpp clangify everything with the new header sorting (#3908) 2020-03-18 17:36:02 -04:00
servatrice_connection_pool.h [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
servatrice_database_interface.cpp [Server] Let users fetch their own private chat history (#7506) 2026-11-09 13:21:43 +01:00
servatrice_database_interface.h [Server] Let users fetch their own private chat history (#7506) 2026-11-09 13:21:43 +01:00
server_logger.cpp [CardDB] Break the CardInfo <-> CardSet cycle on reload (#7645) 2026-10-31 19:37:15 +01:00
server_logger.h [CardDB] Break the CardInfo <-> CardSet cycle on reload (#7645) 2026-10-31 19:37:15 +01:00
serversocketinterface.cpp [Server] Let users fetch their own private chat history (#7506) 2026-11-09 13:21:43 +01:00
serversocketinterface.h [Server] Let users fetch their own private chat history (#7506) 2026-11-09 13:21:43 +01:00
settingscache.cpp [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
settingscache.h [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
signalhandler.cpp [Servatrice] Fail loudly when startup initialization fails (#7602) 2026-10-31 19:02:49 +01:00
signalhandler.h [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
smtpclient.cpp [Servatrice] Use compile-time checked connections (#7631) 2026-11-02 07:13:21 +01:00
smtpclient.h [SMTP] Add reliable email delivery with retry and database-backed queue (#7240) 2026-10-11 20:59:32 +02:00
trusted_sources.cpp [Servatrice] Match trusted_sources by address, not substring (#7582) 2026-10-18 16:50:04 -04:00
trusted_sources.h [Servatrice] Match trusted_sources by address, not substring (#7582) 2026-10-18 16:50:04 -04:00