Skip to content

Commit

Permalink
Merge branch 'release/0.27.9/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Jun 13, 2024
2 parents 11aa1f4 + ff6bc06 commit 28ef121
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Changes in 0.27.9 (2024-06-13)

No significant changes.


## Changes in 0.27.8 (2024-05-29)

🙌 Improvements
Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MatrixSDK"
s.version = "0.27.8"
s.version = "0.27.9"
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"

s.description = <<-DESC
Expand Down
15 changes: 15 additions & 0 deletions MatrixSDK/MXRestClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -1583,6 +1583,21 @@ NS_REFINED_FOR_SWIFT;
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure;

/**
Report a room.
@param roomId the id of the room.
@param reason the redaction reason (optional).
@param success A block object called when the operation succeeds.
@param failure A block object called when the operation fails.
@return a MXHTTPOperation instance.
*/
-(MXHTTPOperation *)reportRoom:(NSString *)roomId
reason:(NSString *)reason
success:(void (^)(void))success
failure:(void (^)(NSError *))failure;

/**
Report an event.
Expand Down
23 changes: 23 additions & 0 deletions MatrixSDK/MXRestClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -3091,6 +3091,29 @@ - (MXHTTPOperation*)redactEvent:(NSString*)eventId
}
failure:^(NSError *error) {
MXStrongifyAndReturnIfNil(self);
[self dispatchFailure:error inBlock:failure];
}];
}

-(MXHTTPOperation *)reportRoom:(NSString *)roomId
reason:(NSString *)reason
success:(void (^)(void))success
failure:(void (^)(NSError *))failure
{
NSString *path = [NSString stringWithFormat:@"%@/org.matrix.msc4151/rooms/%@/report", kMXAPIPrefixPathUnstable, roomId];

NSDictionary *parameters = @{ @"reason": reason.length > 0 ? reason : @"" };

MXWeakify(self);
return [httpClient requestWithMethod:@"POST"
path:path
parameters:parameters
success:^(NSDictionary *JSONResponse) {
MXStrongifyAndReturnIfNil(self);
[self dispatchSuccess:success];
}
failure:^(NSError *error) {
MXStrongifyAndReturnIfNil(self);
[self dispatchFailure:error inBlock:failure];
}];
}
Expand Down

0 comments on commit 28ef121

Please sign in to comment.