Hide the socket status view when censorship circumvention is active.
// FREEBIE
This commit is contained in:
parent
680b2c20d1
commit
d065c95270
|
@ -18,10 +18,6 @@
|
|||
#import "Release.h"
|
||||
#import "SendExternalFileViewController.h"
|
||||
#import "Signal-Swift.h"
|
||||
#import "TSMessagesManager.h"
|
||||
#import "TSSocketManager.h"
|
||||
#import "TSStorageManager+Calling.h"
|
||||
#import "TextSecureKitEnv.h"
|
||||
#import "VersionMigrations.h"
|
||||
#import "ViewControllerUtils.h"
|
||||
#import <AxolotlKit/SessionCipher.h>
|
||||
|
@ -31,7 +27,11 @@
|
|||
#import <SignalServiceKit/OWSIncomingMessageReadObserver.h>
|
||||
#import <SignalServiceKit/OWSMessageSender.h>
|
||||
#import <SignalServiceKit/TSAccountManager.h>
|
||||
#import <SignalServiceKit/TSMessagesManager.h>
|
||||
#import <SignalServiceKit/TSPreKeyManager.h>
|
||||
#import <SignalServiceKit/TSSocketManager.h>
|
||||
#import <SignalServiceKit/TSStorageManager+Calling.h>
|
||||
#import <SignalServiceKit/TextSecureKitEnv.h>
|
||||
|
||||
@import WebRTC;
|
||||
@import Intents;
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "Asserts.h"
|
||||
#import "AttachmentSharing.h"
|
||||
#import "Environment.h"
|
||||
#import "FLAnimatedImage.h"
|
||||
|
@ -14,8 +13,6 @@
|
|||
#import "OWSCallNotificationsAdaptee.h"
|
||||
#import "OWSContactAvatarBuilder.h"
|
||||
#import "OWSContactsManager.h"
|
||||
#import "OWSDispatch.h"
|
||||
#import "OWSError.h"
|
||||
#import "OWSLogger.h"
|
||||
#import "OWSMessageEditing.h"
|
||||
#import "OWSProgressView.h"
|
||||
|
@ -24,8 +21,6 @@
|
|||
#import "PropertyListPreferences.h"
|
||||
#import "PushManager.h"
|
||||
#import "SettingsTableViewController.h"
|
||||
#import "TSSocketManager.h"
|
||||
#import "TSStorageManager+Calling.h"
|
||||
#import "UIColor+OWS.h"
|
||||
#import "UIFont+OWS.h"
|
||||
#import "UIUtil.h"
|
||||
|
@ -38,6 +33,7 @@
|
|||
#import <JSQSystemSoundPlayer.h>
|
||||
#import <PureLayout/PureLayout.h>
|
||||
#import <SignalServiceKit/AppVersion.h>
|
||||
#import <SignalServiceKit/Asserts.h>
|
||||
#import <SignalServiceKit/Contact.h>
|
||||
#import <SignalServiceKit/ContactsUpdater.h>
|
||||
#import <SignalServiceKit/Cryptography.h>
|
||||
|
@ -52,6 +48,7 @@
|
|||
#import <SignalServiceKit/OWSCallIceUpdateMessage.h>
|
||||
#import <SignalServiceKit/OWSCallMessageHandler.h>
|
||||
#import <SignalServiceKit/OWSCallOfferMessage.h>
|
||||
#import <SignalServiceKit/OWSDispatch.h>
|
||||
#import <SignalServiceKit/OWSEndSessionMessage.h>
|
||||
#import <SignalServiceKit/OWSError.h>
|
||||
#import <SignalServiceKit/OWSGetMessagesRequest.h>
|
||||
|
@ -75,6 +72,8 @@
|
|||
#import <SignalServiceKit/TSInfoMessage.h>
|
||||
#import <SignalServiceKit/TSMessagesManager.h>
|
||||
#import <SignalServiceKit/TSNetworkManager.h>
|
||||
#import <SignalServiceKit/TSSocketManager.h>
|
||||
#import <SignalServiceKit/TSStorageManager+Calling.h>
|
||||
#import <SignalServiceKit/TSStorageManager+IdentityKeyStore.h>
|
||||
#import <SignalServiceKit/TSStorageManager+SessionStore.h>
|
||||
#import <SignalServiceKit/TSStorageManager+keyingMaterial.h>
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
#import "PropertyListPreferences.h"
|
||||
#import "PushManager.h"
|
||||
#import "Signal-Swift.h"
|
||||
#import "TSAccountManager.h"
|
||||
#import "TSSocketManager.h"
|
||||
#import "UIUtil.h"
|
||||
#import <SignalServiceKit/TSAccountManager.h>
|
||||
#import <SignalServiceKit/TSSocketManager.h>
|
||||
|
||||
@interface SettingsTableViewController ()
|
||||
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
//
|
||||
// SignalsNavigationController.h
|
||||
// Signal
|
||||
//
|
||||
// Created by Dylan Bourgeois on 18/11/14.
|
||||
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
||||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "TSSocketManager.h"
|
||||
|
||||
@interface SignalsNavigationController : UINavigationController
|
||||
@property (nonatomic, strong) UIProgressView *socketStatusView;
|
||||
@property (nonatomic, strong) NSTimer *updateStatusTimer;
|
||||
|
||||
@end
|
||||
|
|
|
@ -3,16 +3,22 @@
|
|||
//
|
||||
|
||||
#import "SignalsNavigationController.h"
|
||||
|
||||
#import "UIUtil.h"
|
||||
#import <SignalServiceKit/OWSSignalService.h>
|
||||
#import <SignalServiceKit/TSSocketManager.h>
|
||||
|
||||
static double const STALLED_PROGRESS = 0.9;
|
||||
|
||||
@interface SignalsNavigationController ()
|
||||
|
||||
@property (nonatomic) UIProgressView *socketStatusView;
|
||||
@property (nonatomic) NSTimer *updateStatusTimer;
|
||||
|
||||
@end
|
||||
|
||||
static double const STALLED_PROGRESS = 0.9;
|
||||
@implementation SignalsNavigationController
|
||||
#pragma mark -
|
||||
|
||||
@implementation SignalsNavigationController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
@ -36,7 +42,8 @@ static double const STALLED_PROGRESS = 0.9;
|
|||
}
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
|
@ -47,6 +54,17 @@ static double const STALLED_PROGRESS = 0.9;
|
|||
selector:@selector(socketManagerStateDidChange)
|
||||
name:kNSNotification_SocketManagerStateDidChange
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(isCensorshipCircumventionActiveDidChange:)
|
||||
name:kNSNotificationName_IsCensorshipCircumventionActiveDidChange
|
||||
object:nil];
|
||||
}
|
||||
|
||||
- (void)isCensorshipCircumventionActiveDidChange:(NSNotification *)notification
|
||||
{
|
||||
OWSAssert([NSThread isMainThread]);
|
||||
|
||||
[self updateSocketStatusView];
|
||||
}
|
||||
|
||||
- (void)socketManagerStateDidChange {
|
||||
|
@ -57,7 +75,14 @@ static double const STALLED_PROGRESS = 0.9;
|
|||
|
||||
- (void)updateSocketStatusView {
|
||||
OWSAssert([NSThread isMainThread]);
|
||||
|
||||
|
||||
if ([OWSSignalService sharedInstance].isCensorshipCircumventionActive) {
|
||||
[_updateStatusTimer invalidate];
|
||||
[_socketStatusView removeFromSuperview];
|
||||
_socketStatusView = nil;
|
||||
return;
|
||||
}
|
||||
|
||||
switch ([TSSocketManager sharedManager].state) {
|
||||
case SocketManagerStateClosed:
|
||||
if (_socketStatusView == nil) {
|
||||
|
@ -77,12 +102,8 @@ static double const STALLED_PROGRESS = 0.9;
|
|||
break;
|
||||
case SocketManagerStateOpen:
|
||||
[_updateStatusTimer invalidate];
|
||||
for (UIView *view in self.navigationBar.subviews) {
|
||||
if ([view isKindOfClass:[UIProgressView class]]) {
|
||||
[view removeFromSuperview];
|
||||
_socketStatusView = nil;
|
||||
}
|
||||
}
|
||||
[_socketStatusView removeFromSuperview];
|
||||
_socketStatusView = nil;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
#import "PushManager.h"
|
||||
#import "AppDelegate.h"
|
||||
#import "NSData+ows_StripToken.h"
|
||||
#import "NSDate+millisecondTimeStamp.h"
|
||||
#import "OWSContactsManager.h"
|
||||
#import "PropertyListPreferences.h"
|
||||
#import "Signal-Swift.h"
|
||||
#import "TSMessagesManager.h"
|
||||
#import "TSAccountManager.h"
|
||||
#import "TSOutgoingMessage.h"
|
||||
#import "TSSocketManager.h"
|
||||
#import <SignalServiceKit/NSDate+millisecondTimeStamp.h>
|
||||
#import <SignalServiceKit/OWSMessageSender.h>
|
||||
#import <SignalServiceKit/OWSSignalService.h>
|
||||
#import <SignalServiceKit/TSAccountManager.h>
|
||||
#import <SignalServiceKit/TSMessagesManager.h>
|
||||
#import <SignalServiceKit/TSOutgoingMessage.h>
|
||||
#import <SignalServiceKit/TSSocketManager.h>
|
||||
|
||||
#define pushManagerDomain @"org.whispersystems.pushmanager"
|
||||
|
||||
|
|
Loading…
Reference in New Issue