From 87f79b6e339cde288ec3ed0f05210ededcfd0045 Mon Sep 17 00:00:00 2001 From: Andrew Urban Date: Thu, 6 Aug 2015 11:35:38 +0300 Subject: [PATCH] Fixed bug when mostRecentMessageTimestampForRoom returns nil --- Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m b/Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m index f835b3cbcd..b69b379fd8 100644 --- a/Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m +++ b/Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m @@ -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];