mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
add option to delete a user's messages (#4362)
* add option to delete a user's messages add optional parameter remove_messages to the ban and warn commands add event for clients to redact messages implement server side command and message handling implement server history removal todo: client side implementation add option to remove messages to moderator action dialogs add storage of message beginnings to chatview add redactMessage command handle Event_RemoveMessages on rooms this approach is favored over parsing the chatroom after the fact but will use additional memory to store the block indexes this also leaves a problem in that user messages from the chat backlog are not removed in the same way because they don't have a user associated with them add workaround for old qt versions add action for users to remove messages from users in chats add chat history to userMessagePositions with regex proper const usage for userName allow removing the messages of unregistered users add menus to usernames in chat history this allows you to remove user messages on chat history as well this also allows moderators to take actions on users in chat history Apply suggestions from code review * readd missing call to handler
This commit is contained in:
parent
c25bf491e4
commit
1e995cd97c
22 changed files with 280 additions and 78 deletions
|
|
@ -22,6 +22,7 @@ class Event_JoinRoom;
|
|||
class Event_LeaveRoom;
|
||||
class Event_RoomSay;
|
||||
class Event_ListGames;
|
||||
class Event_RemoveMessages;
|
||||
class Command_JoinGame;
|
||||
|
||||
class IslInterface : public QObject
|
||||
|
|
@ -40,6 +41,7 @@ signals:
|
|||
void externalRoomUserLeft(int roomId, QString userName);
|
||||
void externalRoomSay(int roomId, QString userName, QString message);
|
||||
void externalRoomGameListChanged(int roomId, ServerInfo_Game gameInfo);
|
||||
void externalRoomRemoveMessages(int roomId, QString userName, int amount);
|
||||
void joinGameCommandReceived(const Command_JoinGame &cmd, int cmdId, int roomId, int serverId, qint64 sessionId);
|
||||
void gameCommandContainerReceived(const CommandContainer &cont, int playerId, int serverId, qint64 sessionId);
|
||||
void responseReceived(const Response &resp, qint64 sessionId);
|
||||
|
|
@ -68,6 +70,7 @@ private:
|
|||
void roomEvent_UserLeft(int roomId, const Event_LeaveRoom &event);
|
||||
void roomEvent_Say(int roomId, const Event_RoomSay &event);
|
||||
void roomEvent_ListGames(int roomId, const Event_ListGames &event);
|
||||
void roomEvent_RemoveMessages(int roomId, const Event_RemoveMessages &event);
|
||||
|
||||
void roomCommand_JoinGame(const Command_JoinGame &cmd, int cmdId, int roomId, qint64 sessionId);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue