1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-04 10:27:46 +01:00
Telegram/legacy/TelegraphKit/TGContactBinding.m
2015-10-01 19:19:52 +03:00

27 lines
829 B
Objective-C

#import "TGContactBinding.h"
@implementation TGContactBinding
@synthesize phoneId = _phoneId;
@synthesize firstName = _firstName;
@synthesize lastName = _lastName;
@synthesize phoneNumber = _phoneNumber;
- (bool)equalsToContactBinding:(TGContactBinding *)another
{
if (_phoneId != another.phoneId)
return false;
if ((_firstName == nil) != (another.firstName != nil) || (_firstName != nil && ![_firstName isEqualToString:another.firstName]))
return false;
if ((_lastName == nil) != (another.lastName != nil) || (_lastName != nil && ![_lastName isEqualToString:another.lastName]))
return false;
if ((_phoneNumber == nil) != (another.phoneNumber != nil) || (_phoneNumber != nil && ![_phoneNumber isEqualToString:another.phoneNumber]))
return false;
return true;
}
@end