fix latestMessageInRealm(:withConversationType:)

This commit is contained in:
nixzhu
2015-10-12 17:58:07 +08:00
committed by nixzhu
parent 36ce782e98
commit f02db4c93a
+1 -1
View File
@@ -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
}