minor clean

pull/541/head
Ryan Zhao 4 years ago
parent 6d99976a9c
commit cb127be5a2

@ -251,13 +251,14 @@ BOOL IsNoteToSelfEnabled(void)
- (NSUInteger)unreadMessageCountWithTransaction:(YapDatabaseReadTransaction *)transaction
{
__block NSUInteger count = 0;
YapDatabaseViewTransaction *unreadMessages = [transaction ext:TSUnreadDatabaseViewExtensionName];
count = [unreadMessages numberOfItemsInGroup:self.uniqueId];
return count;
return [unreadMessages numberOfItemsInGroup:self.uniqueId];
// FIXME: Why did we have to do as the following?
// __block NSUInteger count = 0;
//
// YapDatabaseViewTransaction *unreadMessages = [transaction ext:TSUnreadDatabaseViewExtensionName];
// [unreadMessages enumerateKeysAndObjectsInGroup:self.uniqueId
// usingBlock:^(NSString *collection, NSString *key, id object, NSUInteger index, BOOL *stop) {
// if (![object conformsToProtocol:@protocol(OWSReadTracking)]) {
@ -270,6 +271,8 @@ BOOL IsNoteToSelfEnabled(void)
// }
// count += 1;
// }];
// return count;
}
- (void)markAllAsReadWithTransaction:(YapDatabaseReadWriteTransaction *)transaction

Loading…
Cancel
Save