mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-12 06:16:09 +10:00
fix latestMessageInRealm(:withConversationType:)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user