mirror of
https://github.com/danog/Telegram.git
synced 2024-12-02 09:27:55 +01:00
35 lines
1003 B
Objective-C
35 lines
1003 B
Objective-C
#import "TGInternalGifSearchResult.h"
|
|
|
|
@implementation TGInternalGifSearchResult
|
|
|
|
- (instancetype)initWithUrl:(NSString *)url document:(TGDocumentMediaAttachment *)document photo:(TGImageMediaAttachment *)photo {
|
|
self = [super init];
|
|
if (self != nil) {
|
|
_url = url;
|
|
_document = document;
|
|
_photo = photo;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
|
|
return [self initWithUrl:[aDecoder decodeObjectForKey:@"url"] document:[aDecoder decodeObjectForKey:@"document"] photo:[aDecoder decodeObjectForKey:@"photo"]];
|
|
}
|
|
|
|
- (void)encodeWithCoder:(NSCoder *)aCoder {
|
|
[aCoder encodeObject:_url forKey:@"url"];
|
|
[aCoder encodeObject:_document forKey:@"document"];
|
|
[aCoder encodeObject:_photo forKey:@"photo"];
|
|
}
|
|
|
|
- (BOOL)isEqual:(id)object
|
|
{
|
|
return [object isKindOfClass:[TGInternalGifSearchResult class]] && TGStringCompare(_url, ((TGInternalGifSearchResult *)object)->_url);
|
|
}
|
|
|
|
- (NSUInteger)hash {
|
|
return [_url hash];
|
|
}
|
|
|
|
@end
|