Add WebRTC setting.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 0c8893e91a
commit 654bdb1a85

@ -4,7 +4,7 @@ source 'https://github.com/CocoaPods/Specs.git'
target 'Signal' do
pod 'SocketRocket', :git => 'https://github.com/facebook/SocketRocket.git'
pod 'AxolotlKit', git: 'https://github.com/WhisperSystems/SignalProtocolKit.git'
pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git', branch: 'mkirk/webrtc'
pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git', branch: 'charlesmchen/webrtcSetting2'
#pod 'SignalServiceKit', path: '../SignalServiceKit'
pod 'OpenSSL'
pod 'PastelogKit', '~> 1.3'

@ -123,7 +123,7 @@ DEPENDENCIES:
- PastelogKit (~> 1.3)
- PureLayout
- SCWaveformView (~> 1.0)
- SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`, branch `mkirk/webrtc`)
- SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`, branch `charlesmchen/webrtcSetting2`)
- SocketRocket (from `https://github.com/facebook/SocketRocket.git`)
- ZXingObjC
@ -131,7 +131,7 @@ EXTERNAL SOURCES:
AxolotlKit:
:git: https://github.com/WhisperSystems/SignalProtocolKit.git
SignalServiceKit:
:branch: mkirk/webrtc
:branch: charlesmchen/webrtcSetting2
:git: https://github.com/WhisperSystems/SignalServiceKit.git
SocketRocket:
:git: https://github.com/facebook/SocketRocket.git
@ -141,7 +141,7 @@ CHECKOUT OPTIONS:
:commit: 714f5ebe199ecc999b33c6f97a4bb57e2db90e75
:git: https://github.com/WhisperSystems/SignalProtocolKit.git
SignalServiceKit:
:commit: d1aa253f87d28ddd47ae4612a654de021d865877
:commit: 08ba42c5635e10205daa3930e3a8550f9048730d
:git: https://github.com/WhisperSystems/SignalServiceKit.git
SocketRocket:
:commit: 41b57bb2fc292a814f758441a05243eb38457027
@ -173,6 +173,6 @@ SPEC CHECKSUMS:
YapDatabase: b1e43555a34a5298e23a045be96817a5ef0da58f
ZXingObjC: bf15b3814f7a105b6d99f47da2333c93a063650a
PODFILE CHECKSUM: 2ae77bac38b8d23b14175ac42d09dd8fce65bb5b
PODFILE CHECKSUM: 00f591b97e32f22474fd96dc29e9ae2fbf9a3075
COCOAPODS: 1.0.1

@ -1,5 +1,6 @@
// Created by Michael Kirk on 10/25/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
import Foundation
import PromiseKit
@ -8,13 +9,13 @@ import PromiseKit
* Signal is actually two services - textSecure for messages and red phone (for calls).
* AccountManager delegates to both.
*/
class AccountManager : NSObject {
class AccountManager: NSObject {
let TAG = "[AccountManager]"
let textSecureAccountManager: TSAccountManager
let networkManager: TSNetworkManager
let redPhoneAccountManager: RPAccountManager
required init(textSecureAccountManager:TSAccountManager, redPhoneAccountManager:RPAccountManager) {
required init(textSecureAccountManager: TSAccountManager, redPhoneAccountManager: RPAccountManager) {
self.networkManager = textSecureAccountManager.networkManager
self.textSecureAccountManager = textSecureAccountManager
self.redPhoneAccountManager = redPhoneAccountManager
@ -23,7 +24,7 @@ class AccountManager : NSObject {
// MARK: registration
@objc func register(verificationCode: String) -> AnyPromise {
return AnyPromise(register(verificationCode: verificationCode));
return AnyPromise(register(verificationCode: verificationCode))
}
func register(verificationCode: String) -> Promise<Void> {
@ -38,7 +39,7 @@ class AccountManager : NSObject {
fulfill()
}
}.then {
Logger.debug("\(self.TAG) verification code looks well formed.");
Logger.debug("\(self.TAG) verification code looks well formed.")
return self.registerForTextSecure(verificationCode: verificationCode)
}.then {
Logger.debug("\(self.TAG) successfully registered for TextSecure")
@ -53,7 +54,9 @@ class AccountManager : NSObject {
private func registerForTextSecure(verificationCode: String) -> Promise<Void> {
return Promise { fulfill, reject in
let isWebRTCEnabled = Environment.preferences().isWebRTCEnabled()
self.textSecureAccountManager.verifyAccount(withCode:verificationCode,
isWebRTCEnabled:isWebRTCEnabled,
success:fulfill,
failure:reject)
}
@ -87,8 +90,8 @@ class AccountManager : NSObject {
}.then {
Logger.info("\(self.TAG) Successfully updated red phone push tokens.")
// TODO code cleanup - convert to `return Promise(value: nil)` and test
return Promise { fulfill, reject in
fulfill();
return Promise { fulfill, _ in
fulfill()
}
}
}

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11542" systemVersion="15G1212" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="tuk-0x-yCb">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1212" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="tuk-0x-yCb">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
@ -431,7 +431,7 @@
<rect key="frame" x="0.0" y="144" width="375" height="108"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="U6h-Xo-HEv" id="Nmz-2u-fOY">
<rect key="frame" x="0.0" y="0.0" width="375" height="108"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="107"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Disappearing Messages" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="qbY-qJ-enK" userLabel="Disappearing Messages">
@ -487,7 +487,7 @@
<rect key="frame" x="0.0" y="252" width="375" height="76"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="3dL-aW-P1A" id="2a2-Po-p8O">
<rect key="frame" x="0.0" y="0.0" width="375" height="76"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="75"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Messages disappear after 8 hours." lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="c6Q-rV-1LO" userLabel="Keep messages for 8 hours.">
@ -533,7 +533,7 @@
<tableViewSection headerTitle="Group Management" id="z5m-Fe-GK8">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="NxZ-wa-xV9" style="IBUITableViewCellStyleDefault" id="XHr-b6-Gvn" userLabel="Update Group">
<rect key="frame" x="0.0" y="384" width="375" height="44"/>
<rect key="frame" x="0.0" y="385" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="XHr-b6-Gvn" id="Epj-vT-UYL">
<rect key="frame" x="0.0" y="0.0" width="342" height="43"/>
@ -553,7 +553,7 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="geN-YN-TQg" style="IBUITableViewCellStyleDefault" id="w57-rz-BWN" userLabel="Leave Group">
<rect key="frame" x="0.0" y="428" width="375" height="44"/>
<rect key="frame" x="0.0" y="429" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="w57-rz-BWN" id="Pgy-Fc-U25">
<rect key="frame" x="0.0" y="0.0" width="342" height="43"/>
@ -570,7 +570,7 @@
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="Zml-Zn-2fd" style="IBUITableViewCellStyleDefault" id="Dnq-Ko-46l" userLabel="Group Members">
<rect key="frame" x="0.0" y="472" width="375" height="44"/>
<rect key="frame" x="0.0" y="473" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Dnq-Ko-46l" id="VRQ-31-E5Y">
<rect key="frame" x="0.0" y="0.0" width="342" height="43"/>
@ -635,7 +635,7 @@
<rect key="frame" x="0.0" y="22" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hyn-Ss-OAa" id="4XE-JO-Upr">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="43"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
@ -936,7 +936,7 @@
<rect key="frame" x="0.0" y="56" width="375" height="72"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="XjV-oU-jSb" id="XqL-QG-IbY">
<rect key="frame" x="0.0" y="0.0" width="375" height="72"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="71"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Signal on Chrome" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="57o-uV-YOg">
@ -980,18 +980,18 @@
<rect key="frame" x="0.0" y="128" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="6h2-gg-1C6" id="RKi-c6-pzb">
<rect key="frame" x="0.0" y="0.0" width="342" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="342" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Link New Device" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="w80-IJ-E6R">
<rect key="frame" x="15" y="4" width="127" height="20.5"/>
<rect key="frame" x="15" y="3" width="127" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Scan QR Code" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="8ft-2u-wBF">
<rect key="frame" x="15" y="24.5" width="88" height="16"/>
<rect key="frame" x="15" y="24" width="88" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -1031,10 +1031,10 @@
</objects>
<point key="canvasLocation" x="-3305" y="-3228"/>
</scene>
<!--_7.0 - Settings-->
<!--Settings-->
<scene sceneID="BD7-1h-slc">
<objects>
<tableViewController storyboardIdentifier="SettingsTableViewController" id="n1f-7Y-906" userLabel="_7.0 - Settings" customClass="SettingsTableViewController" sceneMemberID="viewController">
<tableViewController storyboardIdentifier="SettingsTableViewController" id="n1f-7Y-906" userLabel="Settings" customClass="SettingsTableViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="FhQ-dM-1mj">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@ -1046,7 +1046,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="96"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="5zF-Ko-9qU" id="gr7-Sm-bcs">
<rect key="frame" x="0.0" y="0.0" width="375" height="96"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="95"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1 (708) 000-1234" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ipE-BI-sLL">
@ -1087,7 +1087,7 @@
<rect key="frame" x="0.0" y="96" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="8rk-06-1ZS" id="hqv-P5-du9">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Network Status" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uNq-FV-lwt">
@ -1144,11 +1144,11 @@
<rect key="frame" x="0.0" y="184" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ITG-sW-Zn0" id="vOb-SA-SH2">
<rect key="frame" x="0.0" y="0.0" width="342" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="342" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Privacy" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="i1f-DT-7rL">
<rect key="frame" x="15" y="0.0" width="325" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="325" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -1161,11 +1161,11 @@
<rect key="frame" x="0.0" y="228" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="jp5-vZ-AhJ" id="sji-CJ-bhq">
<rect key="frame" x="0.0" y="0.0" width="342" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="342" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Notifications" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="tRQ-1p-6aT">
<rect key="frame" x="15" y="0.0" width="325" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="325" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -1178,11 +1178,11 @@
<rect key="frame" x="0.0" y="272" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="wZ8-fs-Ylw" id="Ua5-nw-s2z">
<rect key="frame" x="0.0" y="0.0" width="342" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="342" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Linked Devices" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="hrc-lZ-NeA">
<rect key="frame" x="15" y="0.0" width="325" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="325" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -1198,11 +1198,11 @@
<rect key="frame" x="0.0" y="316" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Xx7-pz-aLN" id="pMA-vR-8Ae">
<rect key="frame" x="0.0" y="0.0" width="342" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="342" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Advanced" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="dkL-Nz-E6H">
<rect key="frame" x="15" y="0.0" width="325" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="325" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -1215,11 +1215,11 @@
<rect key="frame" x="0.0" y="360" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="EI4-kQ-MMA" id="czg-5p-aVz">
<rect key="frame" x="0.0" y="0.0" width="342" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="342" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="About" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="qeN-f1-cIQ">
<rect key="frame" x="15" y="0.0" width="325" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="325" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -1236,7 +1236,7 @@
<rect key="frame" x="0.0" y="404" width="375" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="R82-FT-SEA" id="Ok9-fE-WhB">
<rect key="frame" x="0.0" y="0.0" width="375" height="100"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="99"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4Mk-ly-6fq">
@ -1421,7 +1421,7 @@
<rect key="frame" x="0.0" y="22" width="375" height="59"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Ld5-sX-pB8" id="EqP-87-4hZ">
<rect key="frame" x="0.0" y="0.0" width="375" height="59"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="58"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4zF-SU-q4z">
@ -1487,11 +1487,11 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="48"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Pgm-Qb-oPu" id="amG-75-RNT">
<rect key="frame" x="0.0" y="0.0" width="342" height="47.5"/>
<rect key="frame" x="0.0" y="0.0" width="342" height="47"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Invite your friends!" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="QGl-1D-W9D">
<rect key="frame" x="15" y="0.0" width="325" height="47.5"/>
<rect key="frame" x="15" y="0.0" width="325" height="47"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.09412795243864841" green="0.43645224658557435" blue="0.71380208333333339" alpha="1" colorSpace="calibratedRGB"/>
@ -1583,11 +1583,11 @@
<rect key="frame" x="0.0" y="62" width="375" height="60"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="yfF-Jl-bZ1" id="f0v-od-N9K">
<rect key="frame" x="0.0" y="0.0" width="375" height="60"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="59"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="a4j-OQ-ala">
<rect key="frame" x="15" y="0.0" width="345" height="59.5"/>
<rect key="frame" x="15" y="0.0" width="345" height="59"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -1695,8 +1695,8 @@
<simulatedScreenMetrics key="destination" type="retina4_7.fullscreen"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="G2B-Fr-Ezs"/>
<segue reference="tfr-ZV-qWs"/>
<segue reference="E8S-Yc-X7E"/>
<segue reference="wgA-Oo-kKq"/>
<segue reference="G2B-Fr-Ezs"/>
</inferredMetricsTieBreakers>
</document>

@ -1,3 +1,7 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
NS_ASSUME_NONNULL_BEGIN
/**
@ -56,6 +60,9 @@ typedef NS_ENUM(NSUInteger, TSImageQuality) {
- (nullable NSString *)lastRanVersion;
- (NSString *)setAndGetCurrentVersion;
- (BOOL)isWebRTCEnabled;
- (void)setIsWebRTCEnabled:(BOOL)flag;
#pragma mark - Block on Identity Change
- (BOOL)shouldBlockOnIdentityChange;

@ -1,3 +1,7 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "PropertyListPreferences.h"
#import "Constraints.h"
#import "TSStorageHeaders.h"
@ -19,6 +23,7 @@ NSString *const PropertyListPreferencesKeyPlaySoundInForeground = @"Notification
NSString *const PropertyListPreferencesKeyHasRegisteredVoipPush = @"VOIPPushEnabled";
NSString *const PropertyListPreferencesKeyLastRecordedPushToken = @"LastRecordedPushToken";
NSString *const PropertyListPreferencesKeyLastRecordedVoipToken = @"LastRecordedVoipToken";
NSString *const PropertyListPreferencesKeyWebRTCEnabled = @"WebRTCEnabled";
@implementation PropertyListPreferences
@ -84,6 +89,13 @@ NSString *const PropertyListPreferencesKeyLastRecordedVoipToken = @"LastRecorded
return preference ? [preference boolValue] : YES;
}
- (BOOL)isWebRTCEnabled
{
NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyWebRTCEnabled];
// Currently default to NO.
return preference ? [preference boolValue] : NO;
}
- (BOOL)getHasSentAMessage
{
NSNumber *preference = [self tryGetValueForKey:PropertyListPreferencesKeyHasSentAMessage];
@ -125,6 +137,11 @@ NSString *const PropertyListPreferencesKeyLastRecordedVoipToken = @"LastRecorded
[self setValueForKey:PropertyListPreferencesKeyScreenSecurity toValue:@(flag)];
}
- (void)setIsWebRTCEnabled:(BOOL)flag
{
[self setValueForKey:PropertyListPreferencesKeyWebRTCEnabled toValue:@(flag)];
}
- (void)setHasRegisteredVOIPPush:(BOOL)enabled
{
[self setValueForKey:PropertyListPreferencesKeyHasRegisteredVoipPush toValue:@(enabled)];

@ -1,9 +1,5 @@
//
// VersionMigrations.m
// Signal
//
// Created by Frederic Jacobs on 29/07/14.
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "VersionMigrations.h"
@ -155,7 +151,9 @@
__block BOOL success;
TSUpdateAttributesRequest *request = [[TSUpdateAttributesRequest alloc] initWithUpdatedAttributesWithVoice];
BOOL isWebRTCEnabled = [Environment.preferences isWebRTCEnabled];
TSUpdateAttributesRequest *request =
[[TSUpdateAttributesRequest alloc] initWithUpdatedAttributes:isWebRTCEnabled];
[[TSNetworkManager sharedManager] makeRequest:request
success:^(NSURLSessionDataTask *task, id responseObject) {
success = YES;

@ -1,9 +1,5 @@
//
// AdvancedSettingsTableViewController.m
// Signal
//
// Created by Dylan Bourgeois on 05/01/15.
// Copyright (c) 2015 Open Whisper Systems. All rights reserved.
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "AdvancedSettingsTableViewController.h"
@ -23,11 +19,13 @@ NS_ASSUME_NONNULL_BEGIN
@property NSArray *sectionsArray;
@property (strong, nonatomic) UITableViewCell *enableLogCell;
@property (strong, nonatomic) UITableViewCell *submitLogCell;
@property (strong, nonatomic) UITableViewCell *registerPushCell;
@property (nonatomic) UITableViewCell *enableWebRTCCell;
@property (nonatomic) UITableViewCell *enableLogCell;
@property (nonatomic) UITableViewCell *submitLogCell;
@property (nonatomic) UITableViewCell *registerPushCell;
@property (strong, nonatomic) UISwitch *enableLogSwitch;
@property (nonatomic) UISwitch *enableWebRTCSwitch;
@property (nonatomic) UISwitch *enableLogSwitch;
@end
@ -52,18 +50,28 @@ NS_ASSUME_NONNULL_BEGIN
[super loadView];
self.title = NSLocalizedString(@"SETTINGS_ADVANCED_TITLE", @"");
// WebRTC
self.enableWebRTCCell = [[UITableViewCell alloc] init];
self.enableWebRTCCell.textLabel.text = NSLocalizedString(@"SETTINGS_ADVANCED_WEBRTC",
@"This setting is used to switch between new-style WebRTC calling and old-style RedPhone calling.");
self.enableWebRTCCell.userInteractionEnabled = YES;
self.enableWebRTCSwitch = [UISwitch new];
[self.enableWebRTCSwitch setOn:[Environment.preferences isWebRTCEnabled]];
[self.enableWebRTCSwitch addTarget:self
action:@selector(didToggleEnableWebRTCSwitch:)
forControlEvents:UIControlEventTouchUpInside];
self.enableWebRTCCell.accessoryView = self.enableWebRTCSwitch;
// Enable Log
self.enableLogCell = [[UITableViewCell alloc] init];
self.enableLogCell.textLabel.text = NSLocalizedString(@"SETTINGS_ADVANCED_DEBUGLOG", @"");
self.enableLogCell.userInteractionEnabled = YES;
self.enableLogSwitch = [[UISwitch alloc] initWithFrame:CGRectZero];
[self.enableLogSwitch setOn:[Environment.preferences loggingIsEnabled]];
[self.enableLogSwitch addTarget:self
action:@selector(didToggleSwitch:)
action:@selector(didToggleEnableLogSwitch:)
forControlEvents:UIControlEventTouchUpInside];
self.enableLogCell.accessoryView = self.enableLogSwitch;
// Send Log
@ -83,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
switch (section) {
case 0:
return self.enableLogSwitch.isOn ? 2 : 1;
return 1 + (self.enableLogSwitch.isOn ? 2 : 1);
case 1:
return 1;
default:
@ -100,8 +108,10 @@ NS_ASSUME_NONNULL_BEGIN
if (indexPath.section == 0) {
switch (indexPath.row) {
case 0:
return self.enableLogCell;
return self.enableWebRTCCell;
case 1:
return self.enableLogCell;
case 2:
return self.enableLogSwitch.isOn ? self.submitLogCell : self.registerPushCell;
}
} else {
@ -139,14 +149,59 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Actions
- (void)didToggleSwitch:(UISwitch *)sender {
- (void)didToggleEnableWebRTCSwitch:(UISwitch *)sender {
static long long enableWebRTCRequestCounter = 0;
long long enableWebRTCRequestId = ++enableWebRTCRequestCounter;
__weak AdvancedSettingsTableViewController *weakSelf = self;
BOOL isWebRTCEnabled = sender.isOn;
TSUpdateAttributesRequest *request = [[TSUpdateAttributesRequest alloc] initWithUpdatedAttributes:isWebRTCEnabled];
[[TSNetworkManager sharedManager] makeRequest:request
success:^(NSURLSessionDataTask *task, id responseObject) {
// Use the request id to ignore obsolete requests, e.g. if the
// user repeatedly changes the setting faster than the requests
// can complete.
if (enableWebRTCRequestCounter != enableWebRTCRequestId) {
return;
}
// Only update the local setting if the request succeeds;
// otherwise local and service state will fall out of sync
// with every network failure.
[Environment.preferences setIsWebRTCEnabled:isWebRTCEnabled];
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
DDLogError(@"Updating attributes failed with error: %@", error.description);
AdvancedSettingsTableViewController *strongSelf = weakSelf;
// Use the request id to ignore obsolete requests, e.g. if the
// user repeatedly changes the setting faster than the requests
// can complete.
if (!strongSelf ||
enableWebRTCRequestCounter != enableWebRTCRequestId) {
return;
}
// Restore switch to previous state.
[strongSelf.enableLogSwitch setOn:!isWebRTCEnabled];
// Alert.
SignalAlertView(NSLocalizedString(@"SETTINGS_ADVANCED_WEBRTC_FAILED_TITLE",
@"The title of the alert shown when updates to the WebRTC property fail."),
NSLocalizedString(@"SETTINGS_ADVANCED_WEBRTC_FAILED_MESSAGE",
@"The message of the alert shown when updates to the WebRTC property fail."));
}];
}
- (void)didToggleEnableLogSwitch:(UISwitch *)sender {
if (!sender.isOn) {
[[DebugLogger sharedLogger] wipeLogs];
[[DebugLogger sharedLogger] disableFileLogging];
} else {
[[DebugLogger sharedLogger] enableFileLogging];
}
[Environment.preferences setLoggingEnabled:sender.isOn];
[self.tableView reloadData];
}

@ -1,9 +1,5 @@
//
// SettingsTableViewController.m
// Signal
//
// Created by Dylan Bourgeois on 03/11/14.
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "SettingsTableViewController.h"
@ -43,8 +39,8 @@
typedef enum {
kRegisteredRows = 1,
kGeneralRows = 6,
kNetworkStatusRows = 1,
kGeneralRows = 6,
kUnregisterRows = 1,
} kRowsForSection;

@ -73,7 +73,7 @@
/* Accessibilty label for placing call button */
"CALL_LABEL" = "Call";
/* No comment provided by engineer. */
/* notification action */
"CALLBACK_BUTTON_TITLE" = "Call back";
/* Activity Sheet label */
@ -223,13 +223,13 @@
/* No comment provided by engineer. */
"END_CALL_REPLACED_BY_NEXT" = "You Made Another Call.";
/* No comment provided by engineer. */
/* Call setup status label */
"END_CALL_RESPONDER_IS_BUSY" = "Busy.";
/* No comment provided by engineer. */
"END_CALL_STALE_SESSION" = "Missed the Call.";
/* No comment provided by engineer. */
/* Call setup status label */
"END_CALL_UNCATEGORIZED_FAILURE" = "Call Failed.";
/* Generic notice when message failed to send. */
@ -361,10 +361,10 @@
/* Call setup status label */
"IN_CALL_TERMINATED" = "Call Ended.";
/* No comment provided by engineer. */
/* notification body */
"INCOMING_CALL" = "Incoming call";
/* No comment provided by engineer. */
/* notification body */
"INCOMING_CALL_FROM" = "Incoming call from %@";
/* Text for button at the top of the contact picker */
@ -445,7 +445,8 @@
/* {{number of minutes}} embedded in strings, e.g. 'Alice updated disappearing messages expiration to {{5 minutes}}'. See other *_TIME_AMOUNT strings */
"MINUTES_TIME_AMOUNT" = "%u minutes";
/* No comment provided by engineer. */
/* notification body
notification title */
"MISSED_CALL" = "Missed call";
/* Alert body */
@ -454,7 +455,8 @@
/* Alert title */
"MISSING_CAMERA_PERMISSION_TITLE" = "Signal needs to access your camera.";
/* No comment provided by engineer. */
/* notification body
notification title. Embeds {{Caller's Name}} */
"MSGVIEW_MISSED_CALL" = "Missed call from %@.";
/* No comment provided by engineer. */
@ -727,6 +729,15 @@
/* No comment provided by engineer. */
"SETTINGS_ADVANCED_TITLE" = "Advanced";
/* This setting is used to switch between new-style WebRTC calling and old-style RedPhone calling. */
"SETTINGS_ADVANCED_WEBRTC" = "Enable WebRTC Calling";
/* The message of the alert shown when updates to the WebRTC property fail. */
"SETTINGS_ADVANCED_WEBRTC_FAILED_MESSAGE" = "Could not update your preferences.";
/* The title of the alert shown when updates to the WebRTC property fail. */
"SETTINGS_ADVANCED_WEBRTC_FAILED_TITLE" = "Error";
/* User settings section footer, a detailed explanation */
"SETTINGS_BLOCK_ON_IDENITY_CHANGE_DETAIL" = "Requires your approval before communicating with someone who has a new safety number, commonly from a reinstall of Signal.";

Loading…
Cancel
Save