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

Implement MSC3912: redaction with relations #1688

Merged
merged 5 commits into from
Jan 23, 2023

Conversation

nimau
Copy link
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
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 😎

MatrixSDK/Data/MXRoom.m Outdated Show resolved Hide resolved
Copy link
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 :)

MatrixSDK/Data/MXRoom.m Outdated Show resolved Hide resolved
MatrixSDK/Data/MXRoom.m Outdated Show resolved Hide resolved
MatrixSDK/MXRestClient.m Outdated Show resolved Hide resolved
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
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
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
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
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
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
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
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>
Copy link
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
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