|
|
@ -80,6 +80,7 @@
|
|
|
|
#import <SignalServiceKit/OWSIdentityManager.h>
|
|
|
|
#import <SignalServiceKit/OWSIdentityManager.h>
|
|
|
|
#import <SignalServiceKit/OWSMessageManager.h>
|
|
|
|
#import <SignalServiceKit/OWSMessageManager.h>
|
|
|
|
#import <SignalServiceKit/OWSMessageSender.h>
|
|
|
|
#import <SignalServiceKit/OWSMessageSender.h>
|
|
|
|
|
|
|
|
#import <SignalServiceKit/OWSMessageUtils.h>
|
|
|
|
#import <SignalServiceKit/OWSReadReceiptManager.h>
|
|
|
|
#import <SignalServiceKit/OWSReadReceiptManager.h>
|
|
|
|
#import <SignalServiceKit/OWSVerificationStateChangeMessage.h>
|
|
|
|
#import <SignalServiceKit/OWSVerificationStateChangeMessage.h>
|
|
|
|
#import <SignalServiceKit/SignalRecipient.h>
|
|
|
|
#import <SignalServiceKit/SignalRecipient.h>
|
|
|
@ -202,7 +203,6 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
@property (nonatomic, readonly) ContactsUpdater *contactsUpdater;
|
|
|
|
@property (nonatomic, readonly) ContactsUpdater *contactsUpdater;
|
|
|
|
@property (nonatomic, readonly) OWSMessageSender *messageSender;
|
|
|
|
@property (nonatomic, readonly) OWSMessageSender *messageSender;
|
|
|
|
@property (nonatomic, readonly) TSStorageManager *storageManager;
|
|
|
|
@property (nonatomic, readonly) TSStorageManager *storageManager;
|
|
|
|
@property (nonatomic, readonly) OWSMessageManager *messagesManager;
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) TSNetworkManager *networkManager;
|
|
|
|
@property (nonatomic, readonly) TSNetworkManager *networkManager;
|
|
|
|
@property (nonatomic, readonly) OutboundCallInitiator *outboundCallInitiator;
|
|
|
|
@property (nonatomic, readonly) OutboundCallInitiator *outboundCallInitiator;
|
|
|
|
@property (nonatomic, readonly) OWSBlockingManager *blockingManager;
|
|
|
|
@property (nonatomic, readonly) OWSBlockingManager *blockingManager;
|
|
|
@ -274,7 +274,6 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
_messageSender = [Environment current].messageSender;
|
|
|
|
_messageSender = [Environment current].messageSender;
|
|
|
|
_outboundCallInitiator = SignalApp.sharedApp.outboundCallInitiator;
|
|
|
|
_outboundCallInitiator = SignalApp.sharedApp.outboundCallInitiator;
|
|
|
|
_storageManager = [TSStorageManager sharedManager];
|
|
|
|
_storageManager = [TSStorageManager sharedManager];
|
|
|
|
_messagesManager = [OWSMessageManager sharedManager];
|
|
|
|
|
|
|
|
_networkManager = [TSNetworkManager sharedManager];
|
|
|
|
_networkManager = [TSNetworkManager sharedManager];
|
|
|
|
_blockingManager = [OWSBlockingManager sharedManager];
|
|
|
|
_blockingManager = [OWSBlockingManager sharedManager];
|
|
|
|
_contactsViewHelper = [[ContactsViewHelper alloc] initWithDelegate:self];
|
|
|
|
_contactsViewHelper = [[ContactsViewHelper alloc] initWithDelegate:self];
|
|
|
@ -700,7 +699,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NSMutableArray<NSString *> *result = [NSMutableArray new];
|
|
|
|
NSMutableArray<NSString *> *result = [NSMutableArray new];
|
|
|
|
for (NSString *recipientId in self.thread.recipientIdentifiers) {
|
|
|
|
for (NSString *recipientId in self.thread.recipientIdentifiers) {
|
|
|
|
if ([[OWSIdentityManager sharedManager] verificationStateForRecipientId:recipientId]
|
|
|
|
if ([[OWSIdentityManager sharedManager] verificationStateForRecipientIdWithoutTransaction:recipientId]
|
|
|
|
== OWSVerificationStateNoLongerVerified) {
|
|
|
|
== OWSVerificationStateNoLongerVerified) {
|
|
|
|
[result addObject:recipientId];
|
|
|
|
[result addObject:recipientId];
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -927,10 +926,14 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[OWSIdentityManager.sharedManager setVerificationState:OWSVerificationStateDefault
|
|
|
|
[TSStorageManager.protocolStoreDBConnection
|
|
|
|
identityKey:identityKey
|
|
|
|
asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
recipientId:recipientId
|
|
|
|
[OWSIdentityManager.sharedManager setVerificationState:OWSVerificationStateDefault
|
|
|
|
isUserInitiatedChange:YES];
|
|
|
|
identityKey:identityKey
|
|
|
|
|
|
|
|
recipientId:recipientId
|
|
|
|
|
|
|
|
isUserInitiatedChange:YES
|
|
|
|
|
|
|
|
protocolContext:transaction];
|
|
|
|
|
|
|
|
}];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1300,7 +1303,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
|
|
|
|
|
|
|
|
BOOL isVerified = YES;
|
|
|
|
BOOL isVerified = YES;
|
|
|
|
for (NSString *recipientId in self.thread.recipientIdentifiers) {
|
|
|
|
for (NSString *recipientId in self.thread.recipientIdentifiers) {
|
|
|
|
if ([[OWSIdentityManager sharedManager] verificationStateForRecipientId:recipientId]
|
|
|
|
if ([[OWSIdentityManager sharedManager] verificationStateForRecipientIdWithoutTransaction:recipientId]
|
|
|
|
!= OWSVerificationStateVerified) {
|
|
|
|
!= OWSVerificationStateVerified) {
|
|
|
|
isVerified = NO;
|
|
|
|
isVerified = NO;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -3586,7 +3589,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
- (void)updateBackButtonUnreadCount
|
|
|
|
- (void)updateBackButtonUnreadCount
|
|
|
|
{
|
|
|
|
{
|
|
|
|
OWSAssertIsOnMainThread();
|
|
|
|
OWSAssertIsOnMainThread();
|
|
|
|
self.backButtonUnreadCount = [self.messagesManager unreadMessagesCountExcept:self.thread];
|
|
|
|
self.backButtonUnreadCount = [OWSMessageUtils.sharedManager unreadMessagesCountExcept:self.thread];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void)setBackButtonUnreadCount:(NSUInteger)unreadCount
|
|
|
|
- (void)setBackButtonUnreadCount:(NSUInteger)unreadCount
|
|
|
|