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

MXTaggedEvents: Expose "m.tagged_events" according to (MSC2437) #959

Merged
merged 3 commits into from
Dec 4, 2020

Conversation

yostyle
Copy link
Contributor

@yostyle yostyle commented Dec 1, 2020

@yostyle yostyle force-pushed the yostyle/tagged_events branch from 57263b2 to aef2ccd Compare December 2, 2020 09:39
CHANGES.rst Outdated Show resolved Hide resolved
MatrixSDK/JSONModels/MXTaggedEvents.m Outdated Show resolved Hide resolved
MatrixSDK/Data/MXRoomAccountData.m Show resolved Hide resolved
MatrixSDK/Data/MXRoomAccountData.m Show resolved Hide resolved
MatrixSDK/JSONModels/MXTaggedEventInfo.m Show resolved Hide resolved

jsonDictionary[kTaggedEventInfoKewordsJSONKey] = _keywords;
jsonDictionary[kTaggedEventInfoOriginServerTsJSONKey] = @(_originServerTs);
jsonDictionary[kTaggedEventInfoTaggedAtJSONKey] = @(_taggedAt);
Copy link
Member

Choose a reason for hiding this comment

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

I would check whether each value is actually defined before adding them to the dict

NSMutableDictionary<NSString*, NSDictionary<NSString*, NSDictionary*>* > *updatedTags = [_tags mutableCopy];
if (!updatedTags)
{
updatedTags = [NSMutableDictionary dictionary];
Copy link
Member

Choose a reason for hiding this comment

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

I would not allocate this dictionary here. I would not change/update _tags

}
}

_tags = updatedTags;
Copy link
Member

Choose a reason for hiding this comment

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

I would update _tags only in case of an actual change

MatrixSDK/JSONModels/MXTaggedEvents.m Show resolved Hide resolved
@@ -116,6 +116,7 @@ + (void)initialize
kMXEventTypeStringSecretRequest,
kMXEventTypeStringSecretSend,
kMXEventTypeStringSecretStorageDefaultKey,
kMXEventTypeStringTaggedEvents,
Copy link
Member

Choose a reason for hiding this comment

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

We should remove the last comma

@yostyle yostyle force-pushed the yostyle/tagged_events branch from 27b6a71 to 0035edf Compare December 3, 2020 16:37
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

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.

3 participants