Skip to content

Commit

Permalink
invalidated is not property
Browse files Browse the repository at this point in the history
  • Loading branch information
nixzhu committed Aug 11, 2016
1 parent e1aff44 commit 614e555
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions YepKit/Persistence/Models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1325,15 +1325,15 @@ public func filterValidMessages(messages: [Message]) -> [Message] {
}
public func feedConversationsInRealm(realm: Realm) -> Results<Conversation> {
let predicate = NSPredicate(format: "invalidated = false AND withGroup != nil AND withGroup.includeMe = true AND withGroup.groupType = %d", GroupType.Public.rawValue)
let predicate = NSPredicate(format: "withGroup != nil AND withGroup.includeMe = true AND withGroup.groupType = %d", GroupType.Public.rawValue)
let a = SortDescriptor(property: "mentionedMe", ascending: false)
let b = SortDescriptor(property: "hasUnreadMessages", ascending: false)
let c = SortDescriptor(property: "updatedUnixTime", ascending: false)
return realm.objects(Conversation).filter(predicate).sorted([a, b, c])
}
public func mentionedMeInFeedConversationsInRealm(realm: Realm) -> Bool {
let predicate = NSPredicate(format: "invalidated = false AND withGroup != nil AND withGroup.includeMe = true AND withGroup.groupType = %d AND mentionedMe = true", GroupType.Public.rawValue)
let predicate = NSPredicate(format: "withGroup != nil AND withGroup.includeMe = true AND withGroup.groupType = %d AND mentionedMe = true", GroupType.Public.rawValue)
return realm.objects(Conversation).filter(predicate).count > 0
}
Expand All @@ -1342,7 +1342,7 @@ public func countOfConversationsInRealm(realm: Realm) -> Int {
}
public func countOfConversationsInRealm(realm: Realm, withConversationType conversationType: ConversationType) -> Int {
let predicate = NSPredicate(format: "invalidated = false AND type = %d", conversationType.rawValue)
let predicate = NSPredicate(format: "type = %d", conversationType.rawValue)
return realm.objects(Conversation).filter(predicate).count
}
Expand Down

0 comments on commit 614e555

Please sign in to comment.