1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-02 09:27:55 +01:00
Telegram/Telegraph/TGLinkPreviewsContentProperty.m
2015-10-01 19:19:52 +03:00

28 lines
641 B
Objective-C

#import "TGLinkPreviewsContentProperty.h"
#import "PSKeyValueCoder.h"
@implementation TGLinkPreviewsContentProperty
- (instancetype)initWithDisableLinkPreviews:(bool)disableLinkPreviews
{
self = [super init];
if (self != nil)
{
_disableLinkPreviews = disableLinkPreviews;
}
return self;
}
- (instancetype)initWithKeyValueCoder:(PSKeyValueCoder *)coder
{
return [self initWithDisableLinkPreviews:[coder decodeInt32ForCKey:"disableLinkPreviews"] != 0];
}
- (void)encodeWithKeyValueCoder:(PSKeyValueCoder *)coder
{
[coder encodeInt32:_disableLinkPreviews ? 1 : 0 forCKey:"disableLinkPreviews"];
}
@end