diff --git a/Yep/Realm/Models.swift b/Yep/Realm/Models.swift index e2e30fb9..e44366f8 100644 --- a/Yep/Realm/Models.swift +++ b/Yep/Realm/Models.swift @@ -559,7 +559,7 @@ func countOfUnreadMessagesInConversation(conversation: Conversation) -> Int { } func latestMessageInRealm(realm: Realm, withConversationType conversationType: ConversationType) -> Message? { - let predicate = NSPredicate(format: "fromFriend != nil AND fromFriend.friendState != %d AND conversation!= nil AND conversation.type = %d", UserFriendState.Me.rawValue, conversationType.rawValue) + let predicate = NSPredicate(format: "fromFriend != nil AND conversation != nil AND conversation.type = %d", conversationType.rawValue) return realm.objects(Message).filter(predicate).sorted("updatedUnixTime", ascending: false).first }