1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-04 02:17:51 +01:00
Telegram/Watch/Bridge/TGBridgeStickerPack+TGStickerPack.m
2015-10-01 19:19:52 +03:00

27 lines
1015 B
Objective-C

#import "TGBridgeStickerPack+TGStickerPack.h"
#import "TGStickerPack.h"
#import "TGBridgeDocumentMediaAttachment+TGDocumentMediaAttachment.h"
@implementation TGBridgeStickerPack (TGStickerPack)
+ (TGBridgeStickerPack *)stickerPackWithTGStickerPack:(TGStickerPack *)stickerPack
{
TGBridgeStickerPack *bridgeStickerPack = [[TGBridgeStickerPack alloc] init];
bridgeStickerPack->_builtIn = [stickerPack.packReference isKindOfClass:[TGStickerPackBuiltinReference class]];
bridgeStickerPack->_title = stickerPack.title;
NSMutableArray *bridgeDocuments = [[NSMutableArray alloc] init];
for (TGDocumentMediaAttachment *document in stickerPack.documents)
{
TGBridgeDocumentMediaAttachment *bridgeDocument = [TGBridgeDocumentMediaAttachment attachmentWithTGDocumentMediaAttachment:document];
if (bridgeDocument != nil)
[bridgeDocuments addObject:bridgeDocument];
}
bridgeStickerPack->_documents = bridgeDocuments;
return bridgeStickerPack;
}
@end