Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API for unbanning and kicking #367

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions MatrixSDK/MXRestClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -2466,7 +2466,7 @@ - (MXHTTPOperation*)kickUser:(NSString*)userId
[userId stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
parameters[@"membership"] = @"leave";
parameters[@"membership"] = @"kick";

if (reason)
{
Expand Down Expand Up @@ -2536,8 +2536,14 @@ - (MXHTTPOperation*)unbanUser:(NSString*)userId
success:(void (^)())success
failure:(void (^)(NSError *error))failure
{
// Do an unban by resetting the user membership to "leave"
return [self kickUser:userId fromRoom:roomId reason:nil success:success failure:failure];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
parameters[@"user_id"] = userId;

return [self doMembershipRequest:roomId
membership:@"unban"
parameters:parameters
success:success
failure:failure];
}

- (MXHTTPOperation*)createRoom:(NSString*)name
Expand Down