Skip to content

Commit

Permalink
Merge pull request #569 from AndrewMcDrew/mostRecentMessageBug
Browse files Browse the repository at this point in the history
Fixed bug when mostRecentMessageTimestampForRoom returns nil
  • Loading branch information
ObjColumnist committed Aug 6, 2015
2 parents e09d5a3 + 87f79b6 commit db543e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -818,11 +818,11 @@ - (NSDate *)mostRecentMessageTimestampForRoom:(XMPPJID *)roomJID
NSString *streamBareJidStr = [[self myJIDForXMPPStream:xmppStream] bare];

NSString *predicateFormat = @"roomJIDStr == %@ AND streamBareJidStr == %@";
predicate = [NSPredicate predicateWithFormat:predicateFormat, roomJID, streamBareJidStr];
predicate = [NSPredicate predicateWithFormat:predicateFormat, roomJID.bare, streamBareJidStr];
}
else
{
predicate = [NSPredicate predicateWithFormat:@"roomJIDStr == %@", roomJID];
predicate = [NSPredicate predicateWithFormat:@"roomJIDStr == %@", roomJID.bare];
}

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

0 comments on commit db543e1

Please sign in to comment.