mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-01 16:06:59 +00:00
27 lines
1.0 KiB
Objective-C
27 lines
1.0 KiB
Objective-C
#import "TGBridgeStickerPack+TGStickerPack.h"
|
|
#import <LegacyComponents/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
|