|
|
|
@ -137,8 +137,7 @@ static NSString *const OWSMediaGalleryFinderExtensionName = @"OWSMediaGalleryFin
|
|
|
|
|
return NSOrderedSame;
|
|
|
|
|
}
|
|
|
|
|
TSMessage *message2 = (TSMessage *)object2;
|
|
|
|
|
// MJK FIXME - this needs to use sortId
|
|
|
|
|
return [@(message1.timestampForLegacySorting) compare:@(message2.timestampForLegacySorting)];
|
|
|
|
|
return [message1 compareForSorting:message2];
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
YapDatabaseViewGrouping *grouping = [YapDatabaseViewGrouping withObjectBlock:^NSString * _Nullable(YapDatabaseReadTransaction * _Nonnull transaction, NSString * _Nonnull collection, NSString * _Nonnull key, id _Nonnull object) {
|
|
|
|
@ -164,7 +163,7 @@ static NSString *const OWSMediaGalleryFinderExtensionName = @"OWSMediaGalleryFin
|
|
|
|
|
YapDatabaseViewOptions *options = [YapDatabaseViewOptions new];
|
|
|
|
|
options.allowedCollections = [[YapWhitelistBlacklist alloc] initWithWhitelist:[NSSet setWithObject:TSMessage.collection]];
|
|
|
|
|
|
|
|
|
|
return [[YapDatabaseAutoView alloc] initWithGrouping:grouping sorting:sorting versionTag:@"3" options:options];
|
|
|
|
|
return [[YapDatabaseAutoView alloc] initWithGrouping:grouping sorting:sorting versionTag:@"4" options:options];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+ (BOOL)attachmentIdShouldAppearInMediaGallery:(NSString *)attachmentId transaction:(YapDatabaseReadTransaction *)transaction
|
|
|
|
|