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

34 lines
1.2 KiB
Objective-C

#import "TGBridgeImageMediaAttachment+TGImageMediaAttachment.h"
#import "TGBridgeImageInfo+TGImageInfo.h"
@implementation TGBridgeImageMediaAttachment (TGImageMediaAttachment)
+ (TGBridgeImageMediaAttachment *)attachmentWithTGImageMediaAttachment:(TGImageMediaAttachment *)attachment
{
if (attachment == nil)
return nil;
TGBridgeImageMediaAttachment *bridgeAttachment = [[TGBridgeImageMediaAttachment alloc] init];
bridgeAttachment.imageId = attachment.imageId;
bridgeAttachment.localImageId = attachment.localImageId;
bridgeAttachment.imageInfo = [TGBridgeImageInfo imageInfoWithTGImageInfo:attachment.imageInfo];
bridgeAttachment.caption = attachment.caption;
return bridgeAttachment;
}
+ (TGImageMediaAttachment *)tgImageMediaAttachmentWithBridgeImageMediaAttachment:(TGBridgeImageMediaAttachment *)bridgeAttachment
{
if (bridgeAttachment == nil)
return nil;
TGImageMediaAttachment *attachment = [[TGImageMediaAttachment alloc] init];
attachment.imageId = bridgeAttachment.imageId;
attachment.imageInfo = [TGBridgeImageInfo tgImageInfoWithBridgeImageInfo:bridgeAttachment.imageInfo];
attachment.caption = bridgeAttachment.caption;
return attachment;
}
@end