Files
GLEGram-iOS/Telegram/Watch/Bridge/TGBridgeStickersSignals.m
Leeksov 4647310322 GLEGram 12.5 — Initial public release
Based on Swiftgram 12.5 (Telegram iOS 12.5).
All GLEGram features ported and organized in GLEGram/ folder.

Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass,
Font Replacement, Fake Profile, Chat Export, Plugin System, and more.

See CHANGELOG_12.5.md for full details.
2026-04-06 09:48:12 +03:00

51 lines
1.6 KiB
Objective-C

#import "TGBridgeStickersSignals.h"
#import <WatchCommonWatch/WatchCommonWatch.h>
#import "TGBridgeStickerPack.h"
#import "TGBridgeClient.h"
@implementation TGBridgeStickersSignals
static NSArray *cachedStickers = nil;
+ (SSignal *)cachedRecentStickers
{
return [SSignal single:cachedStickers];
}
+ (SSignal *)recentStickersWithLimit:(NSUInteger)limit
{
return [[TGBridgeClient instance] requestSignalWithSubscription:[[TGBridgeRecentStickersSubscription alloc] initWithLimit:limit]];
// return [[self cachedRecentStickers] mapToSignal:^SSignal *(NSArray *stickers) {
// SSignal *remote = [[TGBridgeClient instance] requestSignalWithSubscription:[[TGBridgeRecentStickersSubscription alloc] initWithLimit:limit]];
// remote = [remote onNext:^(NSArray *stickers) {
// cachedStickers = stickers;
// }];
// if (stickers != nil) {
// return [[SSignal single:stickers] then:remote];
// } else {
// return remote;
// }
// }];
}
+ (SSignal *)stickerPacks
{
return [[SSignal single:[[TGBridgeClient instance] stickerPacks]] then:[[TGBridgeClient instance] fileSignalForKey:@"stickers"]];
}
+ (NSURL *)stickerPacksURL
{
static dispatch_once_t onceToken;
static NSURL *stickerPacksURL;
dispatch_once(&onceToken, ^
{
NSString *documentsPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0];
stickerPacksURL = [[NSURL alloc] initFileURLWithPath:[documentsPath stringByAppendingPathComponent:@"stickers.data"]];
});
return stickerPacksURL;
}
@end