Skip to content

Implement MSC3912: redaction with relations#1688

Merged
nimau merged 5 commits intodevelopfrom
nimau/add-msc3912-redaction-with-relations
Jan 23, 2023
Merged

Implement MSC3912: redaction with relations#1688
nimau merged 5 commits intodevelopfrom
nimau/add-msc3912-redaction-with-relations

Conversation

@nimau
Copy link
Copy Markdown
Contributor

@nimau nimau commented Jan 20, 2023

SDK support for MSC3912

@nimau nimau marked this pull request as ready for review January 20, 2023 07:53
@nimau nimau requested a review from phloux January 20, 2023 08:13
Copy link
Copy Markdown
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 😎

Copy link
Copy Markdown
Contributor

@gileluard gileluard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some cosmetic changes but LGTM :)

return [mxSession.matrixRestClient redactEvent:eventId withRelations:relations inRoom:self.roomId reason:reason txnId:nil featureIsStable:isFeatureStable success:success failure:failure];
} else {
MXLogDebug(@"[MXRoom] redaction with relations is not supported (MSC3912)");
return [self redactEvent:eventId reason:reason success:success failure:failure];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we mark this method as deprecated since it is called by - (MXHTTPOperation*)redactEvent:(NSString*)eventId withRelations:(NSArray<NSString *>*)relations reason:(NSString*)reason success:(void (^)(void))success failure:(void (^)(NSError *error))failure if the server doesn't support this new MSC?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx @gileluard , I checked this point with @nimau. Finally he will call here the new implemented redact function (based on the actual redact endpoint) by ignoring the relations

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gileluard: I fixed it in the last commit. Now the fallback (if the MSC3912 is not supported) will be on the new endpoint but without passing any relation types.

Copy link
Copy Markdown
Member

@giomfo giomfo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only one comment

withRelations:(NSArray<NSString *>*)relations
reason:(NSString*)reason
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nimau you have to remove NS_REFINED_FOR_SWIFT macro from here, except if you implement this method in MXRoom.swift file
@pixlwave can you confirm my comment? If this is correct, what is the most suitable action here: remove this macro or add the swift implementation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giomfo, @pixlwave I removed the NS_REFINED_FOR_SWIFT in the last commit as this method is not exposed in MXRoom.swift.

Copy link
Copy Markdown
Member

@pixlwave pixlwave Jan 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my bad, I missed that. Implementing it in Swift would probably be best to my mind. Might be possible to add the extra parameter to the existing method with a default value.

nimau and others added 2 commits January 20, 2023 15:06
Co-authored-by: Gil Eluard <gile@element.io>
@nimau nimau requested review from gileluard and giomfo January 20, 2023 14:18
Copy link
Copy Markdown
Member

@giomfo giomfo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

Copy link
Copy Markdown
Contributor

@gileluard gileluard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants