Skip to content

Commit

Permalink
Direct rooms: Fix MXRoomSummary.directUserId implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
manuroe committed Aug 17, 2018
1 parent e3668f8 commit 700900a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions MatrixSDK/Data/MXRoomSummary.m
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,14 @@ - (NSUInteger)localUnreadEventCount
return [_mxSession.store localUnreadEventCount:_roomId withTypeIn:_mxSession.unreadEventTypes];
}

- (NSString *)directUserId
{
return self.room.directUserId;
}

- (BOOL)isDirect
{
return (_directUserId != nil);
return (self.directUserId != nil);
}

- (void)markAllAsRead
Expand Down Expand Up @@ -540,7 +545,6 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder
_isEncrypted = [aDecoder decodeBoolForKey:@"isEncrypted"];
_notificationCount = (NSUInteger)[aDecoder decodeIntegerForKey:@"notificationCount"];
_highlightCount = (NSUInteger)[aDecoder decodeIntegerForKey:@"highlightCount"];
_directUserId = [aDecoder decodeObjectForKey:@"directUserId"];

_lastMessageEventId = [aDecoder decodeObjectForKey:@"lastMessageEventId"];
_lastMessageOriginServerTs = [aDecoder decodeInt64ForKey:@"lastMessageOriginServerTs"];
Expand Down Expand Up @@ -582,7 +586,6 @@ - (void)encodeWithCoder:(NSCoder *)aCoder
[aCoder encodeBool:_isEncrypted forKey:@"isEncrypted"];
[aCoder encodeInteger:(NSInteger)_notificationCount forKey:@"notificationCount"];
[aCoder encodeInteger:(NSInteger)_highlightCount forKey:@"highlightCount"];
[aCoder encodeObject:[self room].directUserId forKey:@"directUserId"];

// Store last message metadata
[aCoder encodeObject:_lastMessageEventId forKey:@"lastMessageEventId"];
Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK/Data/Store/MXFileStore/MXFileStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#import "MXSDKOptions.h"
#import "MXTools.h"

static NSUInteger const kMXFileVersion = 56;
static NSUInteger const kMXFileVersion = 57;

static NSString *const kMXFileStoreFolder = @"MXFileStore";
static NSString *const kMXFileStoreMedaDataFile = @"MXFileStore";
Expand Down

0 comments on commit 700900a

Please sign in to comment.