Skip to content

Commit

Permalink
Slash command to discard session
Browse files Browse the repository at this point in the history
  • Loading branch information
Anderas committed Sep 5, 2022
1 parent b0dd477 commit eb63e89
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Riot/Modules/MatrixKit/Models/Room/MXKSlashCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ FOUNDATION_EXPORT NSString *const kMXKSlashCmdUnbanUser;
FOUNDATION_EXPORT NSString *const kMXKSlashCmdSetUserPowerLevel;
FOUNDATION_EXPORT NSString *const kMXKSlashCmdResetUserPowerLevel;
FOUNDATION_EXPORT NSString *const kMXKSlashCmdChangeRoomTopic;
FOUNDATION_EXPORT NSString *const kMXKSlashCmdDiscardSession;
1 change: 1 addition & 0 deletions Riot/Modules/MatrixKit/Models/Room/MXKSlashCommands.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@
NSString *const kMXKSlashCmdSetUserPowerLevel = @"/op";
NSString *const kMXKSlashCmdResetUserPowerLevel = @"/deop";
NSString *const kMXKSlashCmdChangeRoomTopic = @"/topic";
NSString *const kMXKSlashCmdDiscardSession = @"/discardsession";
6 changes: 6 additions & 0 deletions Riot/Modules/Room/MXKRoomViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,12 @@ - (BOOL)sendAsIRCStyleCommandIfPossible:(NSString*)string
cmdUsage = @"Usage: /topic <topic>";
}
}
else if ([string hasPrefix:kMXKSlashCmdDiscardSession])
{
[roomDataSource.mxSession.crypto discardOutboundGroupSessionForRoomWithRoomId:roomDataSource.roomId onComplete:^{
MXLogDebug(@"[MXKRoomVC] Manually discarded outbound group session");
}];
}
else
{
// Retrieve userId
Expand Down

0 comments on commit eb63e89

Please sign in to comment.