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

Groups: self-management of membership of groups #429

Merged
merged 2 commits into from
Dec 8, 2017
Merged

Groups: self-management of membership of groups #429

merged 2 commits into from
Dec 8, 2017

Conversation

giomfo
Copy link
Member

@giomfo giomfo commented Dec 5, 2017

  • Handle the list of the groups from the server sync response.

element-hq/riot-meta#114

- Handle the list of the groups from the server sync response.

element-hq/riot-meta#114
@giomfo giomfo requested a review from manuroe December 5, 2017 14:47
@param success A block object called when the operation succeeds.
@param failure A block object called when the operation fails.
*/
- (void)asyncGroups:(void (^)(NSArray<MXGroup *> *groups))success
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please update the files structure provided in this file header?


@property (nonatomic) NSArray<NSString*> *users;

@property (nonatomic) NSDictionary *roles;
Copy link
Contributor

Choose a reason for hiding this comment

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

what is roles?


@property (nonatomic) NSArray<NSString*> *rooms;

@property (nonatomic) NSDictionary *categories;
Copy link
Contributor

Choose a reason for hiding this comment

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

what is categories?

@@ -1222,6 +1256,39 @@ + (id)modelFromJSON:(NSDictionary *)JSONDictionary

@end

@implementation MXGroupsSyncResponse

// Override the default Mantle modelFromJSON method to convert groups lists.
Copy link
Contributor

Choose a reason for hiding this comment

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

We do not use Mantle anymore.

MXGroupProfile *profile = [[MXGroupProfile alloc] init];
if (profile)
{
NSDictionary *dict = [MXJSONModel removeNullValuesInJSON:JSONDictionary];
Copy link
Contributor

Choose a reason for hiding this comment

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

[MXJSONModel removeNullValuesInJSON:] should not be required. It was useful for MXEvent at the beginning of the project

MXGroupSummaryRoomsSection *roomsSection = [[MXGroupSummaryRoomsSection alloc] init];
if (roomsSection)
{
NSDictionary *dict = [MXJSONModel removeNullValuesInJSON:JSONDictionary];
Copy link
Contributor

Choose a reason for hiding this comment

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

useless [MXJSONModel removeNullValuesInJSON:]

MXGroupRoom *room = [[MXGroupRoom alloc] init];
if (room)
{
NSDictionary *dict = [MXJSONModel removeNullValuesInJSON:JSONDictionary];
Copy link
Contributor

Choose a reason for hiding this comment

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

useless [MXJSONModel removeNullValuesInJSON:]

MXGroupRooms *rooms = [[MXGroupRooms alloc] init];
if (rooms)
{
NSDictionary *dict = [MXJSONModel removeNullValuesInJSON:JSONDictionary];
Copy link
Contributor

Choose a reason for hiding this comment

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

useless [MXJSONModel removeNullValuesInJSON:]

MXGroupUser *user = [[MXGroupUser alloc] init];
if (user)
{
NSDictionary *dict = [MXJSONModel removeNullValuesInJSON:JSONDictionary];
Copy link
Contributor

Choose a reason for hiding this comment

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

useless [MXJSONModel removeNullValuesInJSON:]

MXGroupUsers *users = [[MXGroupUsers alloc] init];
if (users)
{
NSDictionary *dict = [MXJSONModel removeNullValuesInJSON:JSONDictionary];
Copy link
Contributor

Choose a reason for hiding this comment

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

useless [MXJSONModel removeNullValuesInJSON:]

@giomfo giomfo merged commit 6093220 into develop Dec 8, 2017
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.

2 participants