mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.3 KiB
Matlab
50 lines
1.3 KiB
Matlab
7 years ago
|
//
|
||
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "OWSUnreadIndicator.h"
|
||
|
|
||
|
NS_ASSUME_NONNULL_BEGIN
|
||
|
|
||
|
@implementation OWSUnreadIndicator
|
||
|
|
||
7 years ago
|
- (instancetype)initWithFirstUnseenSortId:(uint64_t)firstUnseenSortId
|
||
|
hasMoreUnseenMessages:(BOOL)hasMoreUnseenMessages
|
||
|
missingUnseenSafetyNumberChangeCount:(NSUInteger)missingUnseenSafetyNumberChangeCount
|
||
|
unreadIndicatorPosition:(NSInteger)unreadIndicatorPosition
|
||
7 years ago
|
{
|
||
|
self = [super init];
|
||
|
|
||
|
if (!self) {
|
||
|
return self;
|
||
|
}
|
||
|
|
||
7 years ago
|
_firstUnseenSortId = firstUnseenSortId;
|
||
7 years ago
|
_hasMoreUnseenMessages = hasMoreUnseenMessages;
|
||
|
_missingUnseenSafetyNumberChangeCount = missingUnseenSafetyNumberChangeCount;
|
||
|
_unreadIndicatorPosition = unreadIndicatorPosition;
|
||
|
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
- (BOOL)isEqual:(id)object
|
||
|
{
|
||
|
if (self == object) {
|
||
|
return YES;
|
||
|
}
|
||
|
|
||
|
if (![object isKindOfClass:[OWSUnreadIndicator class]]) {
|
||
|
return NO;
|
||
|
}
|
||
|
|
||
|
OWSUnreadIndicator *other = object;
|
||
7 years ago
|
return (self.firstUnseenSortId == other.firstUnseenSortId
|
||
|
&& self.hasMoreUnseenMessages == other.hasMoreUnseenMessages
|
||
7 years ago
|
&& self.missingUnseenSafetyNumberChangeCount == other.missingUnseenSafetyNumberChangeCount
|
||
|
&& self.unreadIndicatorPosition == other.unreadIndicatorPosition);
|
||
|
}
|
||
|
|
||
|
@end
|
||
|
|
||
|
NS_ASSUME_NONNULL_END
|