1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-04 02:17:51 +01:00
Telegram/Watch/Bridge/TGBridgeAudioMediaAttachment+TGAudioMediaAttachment.m
2016-02-25 01:03:51 +01:00

38 lines
1.4 KiB
Objective-C

#import "TGBridgeAudioMediaAttachment+TGAudioMediaAttachment.h"
@implementation TGBridgeAudioMediaAttachment (TGAudioMediaAttachment)
+ (TGBridgeAudioMediaAttachment *)attachmentWithTGAudioMediaAttachment:(TGAudioMediaAttachment *)attachment
{
if (attachment == nil)
return nil;
TGBridgeAudioMediaAttachment *bridgeAttachment = [[TGBridgeAudioMediaAttachment alloc] init];
bridgeAttachment.audioId = attachment.audioId;
bridgeAttachment.accessHash = attachment.accessHash;
bridgeAttachment.datacenterId = attachment.datacenterId;
bridgeAttachment.localAudioId = attachment.localAudioId;
bridgeAttachment.duration = attachment.duration;
bridgeAttachment.fileSize = attachment.fileSize;
return bridgeAttachment;
}
+ (TGAudioMediaAttachment *)tgAudioMediaAttachmentWithBridgeAudioMediaAttachment:(TGBridgeAudioMediaAttachment *)bridgeAttachment
{
if (bridgeAttachment == nil)
return nil;
TGAudioMediaAttachment *attachment = [[TGAudioMediaAttachment alloc] init];
attachment.audioId = bridgeAttachment.audioId;
attachment.accessHash = bridgeAttachment.accessHash;
attachment.datacenterId = bridgeAttachment.datacenterId;
attachment.localAudioId = bridgeAttachment.localAudioId;
attachment.duration = bridgeAttachment.duration;
attachment.fileSize = bridgeAttachment.fileSize;
return attachment;
}
@end