diff --git a/Riot/Modules/MatrixKit/Models/Room/MXKSlashCommands.h b/Riot/Modules/MatrixKit/Models/Room/MXKSlashCommands.h index d2791b9cf..ef9c71783 100644 --- a/Riot/Modules/MatrixKit/Models/Room/MXKSlashCommands.h +++ b/Riot/Modules/MatrixKit/Models/Room/MXKSlashCommands.h @@ -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; diff --git a/Riot/Modules/MatrixKit/Models/Room/MXKSlashCommands.m b/Riot/Modules/MatrixKit/Models/Room/MXKSlashCommands.m index b83e42f3e..e9d483d9b 100644 --- a/Riot/Modules/MatrixKit/Models/Room/MXKSlashCommands.m +++ b/Riot/Modules/MatrixKit/Models/Room/MXKSlashCommands.m @@ -27,3 +27,4 @@ NSString *const kMXKSlashCmdUnbanUser = @"/unban"; NSString *const kMXKSlashCmdSetUserPowerLevel = @"/op"; NSString *const kMXKSlashCmdResetUserPowerLevel = @"/deop"; NSString *const kMXKSlashCmdChangeRoomTopic = @"/topic"; +NSString *const kMXKSlashCmdDiscardSession = @"/discardsession"; diff --git a/Riot/Modules/Room/MXKRoomViewController.m b/Riot/Modules/Room/MXKRoomViewController.m index a720744cc..65dc73a3e 100644 --- a/Riot/Modules/Room/MXKRoomViewController.m +++ b/Riot/Modules/Room/MXKRoomViewController.m @@ -1438,6 +1438,12 @@ cmdUsage = @"Usage: /topic "; } } + else if ([string hasPrefix:kMXKSlashCmdDiscardSession]) + { + [roomDataSource.mxSession.crypto discardOutboundGroupSessionForRoomWithRoomId:roomDataSource.roomId onComplete:^{ + MXLogDebug(@"[MXKRoomVC] Manually discarded outbound group session"); + }]; + } else { // Retrieve userId diff --git a/changelog.d/pr-6668.change b/changelog.d/pr-6668.change new file mode 100644 index 000000000..c659928fe --- /dev/null +++ b/changelog.d/pr-6668.change @@ -0,0 +1 @@ +Crypto: Slash command to discard outbound session