1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-03 09:57:46 +01:00
Telegram/Telegraph/TLMessageFwdHeader$messageFwdHeader.m
2016-02-25 01:03:51 +01:00

37 lines
1.1 KiB
Objective-C

#import "TLMessageFwdHeader$messageFwdHeader.h"
//messageFwdHeader flags:# from_id:flags.0?int date:int channel_id:flags.1?int channel_post:flags.2?int = MessageFwdHeader
@implementation TLMessageFwdHeader$messageFwdHeader
- (void)TLserialize:(NSOutputStream *)__unused os
{
TGLog(@"***** TLMessageFwdHeader$messageFwdHeader serialization not supported");
}
- (id<TLObject>)TLdeserialize:(NSInputStream *)is signature:(int32_t)__unused signature environment:(id<TLSerializationEnvironment>)__unused environment context:(TLSerializationContext *)__unused context error:(__autoreleasing NSError **)__unused error
{
TLMessageFwdHeader$messageFwdHeader *result = [[TLMessageFwdHeader$messageFwdHeader alloc] init];
int32_t flags = [is readInt32];
result.flags = flags;
if (flags & (1 << 0)) {
result.from_id = [is readInt32];
}
result.date = [is readInt32];
if (flags & (1 << 1)) {
result.channel_id = [is readInt32];
}
if (flags & (1 << 2)) {
result.channel_post = [is readInt32];
}
return result;
}
@end