Skip to content

Commit db543e1

Browse files
committed
Merge pull request robbiehanson#569 from AndrewMcDrew/mostRecentMessageBug
Fixed bug when mostRecentMessageTimestampForRoom returns nil
2 parents e09d5a3 + 87f79b6 commit db543e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,11 +818,11 @@ - (NSDate *)mostRecentMessageTimestampForRoom:(XMPPJID *)roomJID
818818
NSString *streamBareJidStr = [[self myJIDForXMPPStream:xmppStream] bare];
819819

820820
NSString *predicateFormat = @"roomJIDStr == %@ AND streamBareJidStr == %@";
821-
predicate = [NSPredicate predicateWithFormat:predicateFormat, roomJID, streamBareJidStr];
821+
predicate = [NSPredicate predicateWithFormat:predicateFormat, roomJID.bare, streamBareJidStr];
822822
}
823823
else
824824
{
825-
predicate = [NSPredicate predicateWithFormat:@"roomJIDStr == %@", roomJID];
825+
predicate = [NSPredicate predicateWithFormat:@"roomJIDStr == %@", roomJID.bare];
826826
}
827827

828828
NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"localTimestamp" ascending:NO];

0 commit comments

Comments
 (0)