1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-03 09:57:46 +01:00
Telegram/Watch/Bridge/TGBridgeStickersSignals.m
2015-10-01 19:19:52 +03:00

35 lines
1.1 KiB
Objective-C

#import "TGBridgeStickersSignals.h"
#import "TGBridgeStickersSubscription.h"
#import "TGBridgeResponse.h"
#import "TGBridgeStickerPack.h"
#import "TGBridgeDocumentMediaAttachment.h"
#import "TGBridgeClient.h"
@implementation TGBridgeStickersSignals
+ (SSignal *)recentStickersWithLimit:(NSUInteger)limit
{
return [[TGBridgeClient instance] requestSignalWithSubscription:[[TGBridgeRecentStickersSubscription alloc] initWithLimit:limit]];
}
static NSArray *stickerPacks = nil;
+ (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