mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Merge branch 'charlesmchen/manualCensorshipCircumvention'
This commit is contained in:
commit
d8d4d75227
1
Podfile
1
Podfile
|
@ -11,6 +11,7 @@ target 'Signal' do
|
|||
pod 'JSQMessagesViewController', git: 'https://github.com/WhisperSystems/JSQMessagesViewController.git', branch: 'mkirk/position-edit-menu'
|
||||
#pod 'JSQMessagesViewController' path: '../JSQMessagesViewController'
|
||||
pod 'PureLayout'
|
||||
pod 'Reachability'
|
||||
target 'SignalTests' do
|
||||
inherit! :search_paths
|
||||
end
|
||||
|
|
|
@ -39,6 +39,7 @@ PODS:
|
|||
- OpenSSL (1.0.210)
|
||||
- ProtocolBuffers (1.9.11)
|
||||
- PureLayout (3.0.2)
|
||||
- Reachability (3.2)
|
||||
- SAMKeychain (1.5.2)
|
||||
- SignalServiceKit (0.9.0):
|
||||
- '25519'
|
||||
|
@ -112,6 +113,7 @@ DEPENDENCIES:
|
|||
- JSQMessagesViewController (from `https://github.com/WhisperSystems/JSQMessagesViewController.git`, branch `mkirk/position-edit-menu`)
|
||||
- OpenSSL
|
||||
- PureLayout
|
||||
- Reachability
|
||||
- SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`)
|
||||
- SocketRocket (from `https://github.com/facebook/SocketRocket.git`)
|
||||
|
||||
|
@ -134,7 +136,7 @@ CHECKOUT OPTIONS:
|
|||
:commit: 7054e4b13ee5bcd6d524adb6dc9a726e8c466308
|
||||
:git: https://github.com/WhisperSystems/JSQMessagesViewController.git
|
||||
SignalServiceKit:
|
||||
:commit: cbeafac20ebb0437baf8982381c1980db276681f
|
||||
:commit: d61235825680e9b563f28cbbbaf6772c19f85674
|
||||
:git: https://github.com/WhisperSystems/SignalServiceKit.git
|
||||
SocketRocket:
|
||||
:commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf
|
||||
|
@ -153,6 +155,7 @@ SPEC CHECKSUMS:
|
|||
OpenSSL: 246ffb948e9d56466727fd318134af35f5aa764e
|
||||
ProtocolBuffers: d509225eb2ea43d9582a59e94348fcf86e2abd65
|
||||
PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd
|
||||
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
|
||||
SAMKeychain: 1865333198217411f35327e8da61b43de79b635b
|
||||
SignalServiceKit: 2ad8d86da055e24ac3ea0354ec1d4b13251af28f
|
||||
SocketRocket: dbb1554b8fc288ef8ef370d6285aeca7361be31e
|
||||
|
@ -161,6 +164,6 @@ SPEC CHECKSUMS:
|
|||
UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d
|
||||
YapDatabase: cd911121580ff16675f65ad742a9eb0ab4d9e266
|
||||
|
||||
PODFILE CHECKSUM: cb2cbbe74dab34123e1cb527417ef658aa60bd26
|
||||
PODFILE CHECKSUM: 48e80d7f1e049bbf544a689fdfdf33e8196c640a
|
||||
|
||||
COCOAPODS: 1.2.1
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
3456710A1E8A9F5D006EE662 /* TSGenericAttachmentAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 345671091E8A9F5D006EE662 /* TSGenericAttachmentAdapter.m */; };
|
||||
3471B1DA1EB7C63600F6AEC8 /* NewNonContactConversationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3471B1D91EB7C63600F6AEC8 /* NewNonContactConversationViewController.m */; };
|
||||
3472229F1EB22FFE00E53955 /* AddToGroupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3472229E1EB22FFE00E53955 /* AddToGroupViewController.m */; };
|
||||
3497DBEC1ECE257500DB2605 /* OWSCountryMetadata.m in Sources */ = {isa = PBXBuildFile; fileRef = 3497DBEB1ECE257500DB2605 /* OWSCountryMetadata.m */; };
|
||||
3497DBEF1ECE2E4700DB2605 /* DomainFrontingCountryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3497DBEE1ECE2E4700DB2605 /* DomainFrontingCountryViewController.m */; };
|
||||
34B3F8711E8DF1700035BE1A /* AboutTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8351E8DF1700035BE1A /* AboutTableViewController.m */; };
|
||||
34B3F8721E8DF1700035BE1A /* AdvancedSettingsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8371E8DF1700035BE1A /* AdvancedSettingsTableViewController.m */; };
|
||||
34B3F8731E8DF1700035BE1A /* AttachmentApprovalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8381E8DF1700035BE1A /* AttachmentApprovalViewController.swift */; };
|
||||
|
@ -396,6 +398,10 @@
|
|||
3471B1D91EB7C63600F6AEC8 /* NewNonContactConversationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewNonContactConversationViewController.m; sourceTree = "<group>"; };
|
||||
3472229D1EB22FFE00E53955 /* AddToGroupViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddToGroupViewController.h; sourceTree = "<group>"; };
|
||||
3472229E1EB22FFE00E53955 /* AddToGroupViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddToGroupViewController.m; sourceTree = "<group>"; };
|
||||
3497DBEA1ECE257500DB2605 /* OWSCountryMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSCountryMetadata.h; sourceTree = "<group>"; };
|
||||
3497DBEB1ECE257500DB2605 /* OWSCountryMetadata.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSCountryMetadata.m; sourceTree = "<group>"; };
|
||||
3497DBED1ECE2E4700DB2605 /* DomainFrontingCountryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DomainFrontingCountryViewController.h; sourceTree = "<group>"; };
|
||||
3497DBEE1ECE2E4700DB2605 /* DomainFrontingCountryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DomainFrontingCountryViewController.m; sourceTree = "<group>"; };
|
||||
34B3F8341E8DF1700035BE1A /* AboutTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AboutTableViewController.h; sourceTree = "<group>"; };
|
||||
34B3F8351E8DF1700035BE1A /* AboutTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AboutTableViewController.m; sourceTree = "<group>"; };
|
||||
34B3F8361E8DF1700035BE1A /* AdvancedSettingsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdvancedSettingsTableViewController.h; sourceTree = "<group>"; };
|
||||
|
@ -898,6 +904,8 @@
|
|||
34B3F8401E8DF1700035BE1A /* CountryCodeViewController.h */,
|
||||
34B3F8411E8DF1700035BE1A /* CountryCodeViewController.m */,
|
||||
34D8C0221ED3673300188D7C /* DebugUI */,
|
||||
3497DBED1ECE2E4700DB2605 /* DomainFrontingCountryViewController.h */,
|
||||
3497DBEE1ECE2E4700DB2605 /* DomainFrontingCountryViewController.m */,
|
||||
34B3F8441E8DF1700035BE1A /* ExperienceUpgradesPageViewController.swift */,
|
||||
34B3F8451E8DF1700035BE1A /* FingerprintViewController.h */,
|
||||
34B3F8461E8DF1700035BE1A /* FingerprintViewController.m */,
|
||||
|
@ -930,6 +938,8 @@
|
|||
34B3F85B1E8DF1700035BE1A /* OWSConversationSettingsTableViewController.h */,
|
||||
34B3F85C1E8DF1700035BE1A /* OWSConversationSettingsTableViewController.m */,
|
||||
34D5CCAB1EAE7136005515DB /* OWSConversationSettingsViewDelegate.h */,
|
||||
3497DBEA1ECE257500DB2605 /* OWSCountryMetadata.h */,
|
||||
3497DBEB1ECE257500DB2605 /* OWSCountryMetadata.m */,
|
||||
34B3F85D1E8DF1700035BE1A /* OWSLinkDeviceViewController.h */,
|
||||
34B3F85E1E8DF1700035BE1A /* OWSLinkDeviceViewController.m */,
|
||||
34B3F85F1E8DF1700035BE1A /* OWSLinkedDevicesTableViewController.h */,
|
||||
|
@ -2113,6 +2123,7 @@
|
|||
45E615161E8C590B0018AD52 /* DisplayableTextFilter.swift in Sources */,
|
||||
34B3F88A1E8DF1700035BE1A /* OWSLinkDeviceViewController.m in Sources */,
|
||||
76EB068618170B34006006FC /* ContactTableViewCell.m in Sources */,
|
||||
3497DBEF1ECE2E4700DB2605 /* DomainFrontingCountryViewController.m in Sources */,
|
||||
34B3F8881E8DF1700035BE1A /* OversizeTextMessageViewController.swift in Sources */,
|
||||
34330AA31E79686200DF2FB9 /* OWSProgressView.m in Sources */,
|
||||
34B3F8A21E8EA6040035BE1A /* ViewControllerUtils.m in Sources */,
|
||||
|
@ -2130,6 +2141,7 @@
|
|||
450573FE1E78A06D00615BB4 /* OWS103EnableVideoCalling.m in Sources */,
|
||||
34B3F8751E8DF1700035BE1A /* CallViewController.swift in Sources */,
|
||||
34D8C0281ED3673300188D7C /* DebugUITableViewController.m in Sources */,
|
||||
3497DBEC1ECE257500DB2605 /* OWSCountryMetadata.m in Sources */,
|
||||
34B3F8851E8DF1700035BE1A /* NewGroupViewController.m in Sources */,
|
||||
B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */,
|
||||
34D8C0271ED3673300188D7C /* DebugUIMessages.m in Sources */,
|
||||
|
|
|
@ -26,7 +26,7 @@ class MessageFetcherJob: NSObject {
|
|||
|
||||
func runAsync() {
|
||||
Logger.debug("\(TAG) \(#function)")
|
||||
guard signalService.isCensored else {
|
||||
guard signalService.isCensorshipCircumventionActive else {
|
||||
Logger.debug("\(self.TAG) delegating message fetching to SocketManager since we're using normal transport.")
|
||||
TSSocketManager.requestSocketOpen()
|
||||
return
|
||||
|
|
|
@ -415,7 +415,7 @@
|
|||
<!--Linked Devices-->
|
||||
<scene sceneID="R59-ey-Ucx">
|
||||
<objects>
|
||||
<tableViewController id="euf-gj-Iag" customClass="OWSLinkedDevicesTableViewController" sceneMemberID="viewController">
|
||||
<tableViewController storyboardIdentifier="OWSLinkedDevicesTableViewController" id="euf-gj-Iag" customClass="OWSLinkedDevicesTableViewController" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" allowsSelectionDuringEditing="YES" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" id="zqK-o2-Psk">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
|
@ -524,267 +524,11 @@
|
|||
<scene sceneID="BD7-1h-slc">
|
||||
<objects>
|
||||
<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"/>
|
||||
<color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.95686274509803926" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<sections>
|
||||
<tableViewSection id="2XP-ps-mfi">
|
||||
<cells>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="96" id="5zF-Ko-9qU">
|
||||
<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="95.5"/>
|
||||
<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">
|
||||
<rect key="frame" x="8" y="52" width="359" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="21" id="hnY-fM-R9C"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
|
||||
<color key="textColor" red="0.67349421977996826" green="0.67362350225448608" blue="0.67347252368927002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Registered Number" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3Pu-Cs-0K2">
|
||||
<rect key="frame" x="8" y="22" width="359" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="MJo-RF-hP8"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="20"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="3Pu-Cs-0K2" firstAttribute="leading" secondItem="gr7-Sm-bcs" secondAttribute="leadingMargin" id="Y9p-u3-0aa"/>
|
||||
<constraint firstItem="3Pu-Cs-0K2" firstAttribute="top" secondItem="gr7-Sm-bcs" secondAttribute="topMargin" constant="14" id="a9L-QN-6dN"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="3Pu-Cs-0K2" secondAttribute="trailing" id="hch-DE-uSe"/>
|
||||
<constraint firstItem="ipE-BI-sLL" firstAttribute="top" secondItem="3Pu-Cs-0K2" secondAttribute="bottom" id="jCc-x8-YQK"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="ipE-BI-sLL" secondAttribute="trailing" id="ocR-u4-a2s"/>
|
||||
<constraint firstItem="ipE-BI-sLL" firstAttribute="leading" secondItem="gr7-Sm-bcs" secondAttribute="leadingMargin" id="zCd-GH-BpM"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
</tableViewCell>
|
||||
</cells>
|
||||
</tableViewSection>
|
||||
<tableViewSection id="Ga1-YS-vMz">
|
||||
<cells>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="8rk-06-1ZS" userLabel="Network Status Cell">
|
||||
<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="43.5"/>
|
||||
<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">
|
||||
<rect key="frame" x="15" y="-0.5" width="200" height="44"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="44" id="nOw-0c-lAd"/>
|
||||
<constraint firstAttribute="width" constant="200" id="q6L-Sa-lrA"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<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" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Connected" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsLetterSpacingToFitWidth="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tg3-dQ-odw">
|
||||
<rect key="frame" x="260" y="-0.5" width="100" height="44"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="100" id="Lw2-Fv-sOC"/>
|
||||
<constraint firstAttribute="height" constant="44" id="uvH-QZ-iUw"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleCallout"/>
|
||||
<color key="textColor" red="0.51886790990829468" green="1" blue="0.46843132376670837" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="tg3-dQ-odw" firstAttribute="centerY" secondItem="hqv-P5-du9" secondAttribute="centerY" id="53z-bi-mXN"/>
|
||||
<constraint firstItem="uNq-FV-lwt" firstAttribute="leading" secondItem="hqv-P5-du9" secondAttribute="leadingMargin" constant="7" id="ViZ-i6-VOo"/>
|
||||
<constraint firstAttribute="centerY" secondItem="uNq-FV-lwt" secondAttribute="centerY" id="d7b-Jy-1gQ"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="tg3-dQ-odw" secondAttribute="trailing" constant="7" id="xHz-d7-B39"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</cells>
|
||||
</tableViewSection>
|
||||
<tableViewSection id="JqD-8c-dMF">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="9FD-M0-WLe" style="IBUITableViewCellStyleDefault" id="a7a-qe-87x" userLabel="Invite Your Friends">
|
||||
<rect key="frame" x="0.0" y="140" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="a7a-qe-87x" id="gcU-Ld-alv">
|
||||
<rect key="frame" x="0.0" y="0.0" width="342" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Invite Your Friends" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="9FD-M0-WLe" userLabel="Invite Your Friends">
|
||||
<rect key="frame" x="15" y="0.0" width="325" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="i1f-DT-7rL" style="IBUITableViewCellStyleDefault" id="ITG-sW-Zn0" userLabel="Privacy Cell">
|
||||
<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="43.5"/>
|
||||
<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"/>
|
||||
<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>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="tRQ-1p-6aT" style="IBUITableViewCellStyleDefault" id="jp5-vZ-AhJ" userLabel="Notifications Cell">
|
||||
<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="43.5"/>
|
||||
<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"/>
|
||||
<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>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="hrc-lZ-NeA" style="IBUITableViewCellStyleDefault" id="wZ8-fs-Ylw" userLabel="Linked Devices Cell">
|
||||
<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="43.5"/>
|
||||
<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"/>
|
||||
<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>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<segue destination="euf-gj-Iag" kind="push" id="Mpp-7k-YTc"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="dkL-Nz-E6H" style="IBUITableViewCellStyleDefault" id="Xx7-pz-aLN" userLabel="Advanced Cell">
|
||||
<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="43.5"/>
|
||||
<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"/>
|
||||
<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>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="qeN-f1-cIQ" style="IBUITableViewCellStyleDefault" id="EI4-kQ-MMA" userLabel="About Cell">
|
||||
<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="43.5"/>
|
||||
<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"/>
|
||||
<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>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</cells>
|
||||
</tableViewSection>
|
||||
<tableViewSection id="FdD-MV-PUQ">
|
||||
<cells>
|
||||
<tableViewCell autoresizesSubviews="NO" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="100" id="R82-FT-SEA" userLabel="Destroy Account Cell">
|
||||
<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="99.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4Mk-ly-6fq">
|
||||
<rect key="frame" x="15" y="25" width="340" height="50"/>
|
||||
<color key="backgroundColor" red="0.98639106750488281" green="0.10408364236354828" blue="0.33135244250297546" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="Pwj-l2-Tav"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<state key="normal" title="Destroy Account">
|
||||
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="unregisterUser:" destination="n1f-7Y-906" eventType="touchUpInside" id="GA2-Ke-con"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="4Mk-ly-6fq" firstAttribute="leading" secondItem="Ok9-fE-WhB" secondAttribute="leadingMargin" constant="7" id="0dH-Hz-wMU"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="4Mk-ly-6fq" secondAttribute="trailing" constant="12" id="Hwq-uT-qGp"/>
|
||||
<constraint firstItem="4Mk-ly-6fq" firstAttribute="top" secondItem="Ok9-fE-WhB" secondAttribute="topMargin" constant="17" id="TQa-bs-YNu"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</cells>
|
||||
</tableViewSection>
|
||||
</sections>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="n1f-7Y-906" id="AZ1-t5-kxA"/>
|
||||
<outlet property="delegate" destination="n1f-7Y-906" id="qdU-Y6-vJ9"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<toolbarItems/>
|
||||
<navigationItem key="navigationItem" title="Settings" id="Yrv-vP-ZVP" userLabel="_7.0a - Navigation Bar">
|
||||
<barButtonItem key="leftBarButtonItem" style="done" systemItem="done" id="B0V-Wf-lqd">
|
||||
<inset key="imageInsets" minX="-10" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<segue destination="0Ge-H7-b9J" kind="unwind" unwindAction="unwindSettingsDone:" id="ud5-xW-wwg"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
</navigationItem>
|
||||
<navigationItem key="navigationItem" title="Settings" id="Yrv-vP-ZVP" userLabel="_7.0a - Navigation Bar"/>
|
||||
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
|
||||
<connections>
|
||||
<outlet property="aboutLabel" destination="qeN-f1-cIQ" id="kmc-iU-NK5"/>
|
||||
<outlet property="advancedLabel" destination="dkL-Nz-E6H" id="HUw-SB-apQ"/>
|
||||
<outlet property="destroyAccountButton" destination="4Mk-ly-6fq" id="6Xj-Rb-kfF"/>
|
||||
<outlet property="inviteLabel" destination="9FD-M0-WLe" id="TfU-b4-OtN"/>
|
||||
<outlet property="linkedDevicesLabel" destination="hrc-lZ-NeA" id="VkD-E5-2kW"/>
|
||||
<outlet property="networkStatusHeader" destination="uNq-FV-lwt" id="vca-cC-nXG"/>
|
||||
<outlet property="networkStatusLabel" destination="tg3-dQ-odw" id="l6J-8y-maW"/>
|
||||
<outlet property="notificationsLabel" destination="tRQ-1p-6aT" id="sbi-Q3-Mge"/>
|
||||
<outlet property="privacyLabel" destination="i1f-DT-7rL" id="vsz-Rp-jjQ"/>
|
||||
<outlet property="registeredName" destination="3Pu-Cs-0K2" id="9av-hR-AZO"/>
|
||||
<outlet property="registeredNumber" destination="ipE-BI-sLL" id="uQB-V6-ooY"/>
|
||||
</connections>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="b8Q-ui-1Tb" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
<exit id="0Ge-H7-b9J" userLabel="Exit" sceneMemberID="exit"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-2867" y="-3230"/>
|
||||
</scene>
|
||||
|
@ -801,28 +545,28 @@
|
|||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6B0-ZZ-d6K" userLabel="Instructions">
|
||||
<rect key="frame" x="16" y="343.5" width="343" height="279.5"/>
|
||||
<rect key="frame" x="16" y="343.5" width="343" height="323.5"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Oqf-fj-8Va" userLabel="Spacer">
|
||||
<rect key="frame" x="0.0" y="0.0" width="343" height="64.5"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="343" height="86.5"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="16" id="Xq5-fV-fUr"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_devices_ios" translatesAutoresizingMaskIntoConstraints="NO" id="zl7-KG-ma4">
|
||||
<rect key="frame" x="86" y="64.5" width="171" height="114"/>
|
||||
<rect key="frame" x="86" y="86.5" width="171" height="114"/>
|
||||
<color key="tintColor" red="0.67450980392156867" green="0.67450980392156867" blue="0.67450980392156867" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="zl7-KG-ma4" secondAttribute="height" multiplier="3:2" id="RKt-hc-iWB"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GMf-cM-kQN" userLabel="Spacer">
|
||||
<rect key="frame" x="0.0" y="215.5" width="343" height="64"/>
|
||||
<rect key="frame" x="0.0" y="237.5" width="343" height="86"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Scan the QR code displayed on the device to link." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="3D8-yn-TJ8">
|
||||
<rect key="frame" x="0.0" y="194.5" width="343" height="21"/>
|
||||
<rect key="frame" x="0.0" y="216.5" width="343" height="21"/>
|
||||
<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"/>
|
||||
|
@ -848,7 +592,7 @@
|
|||
</constraints>
|
||||
</view>
|
||||
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eF5-us-VJe">
|
||||
<rect key="frame" x="0.0" y="64" width="375" height="279.5"/>
|
||||
<rect key="frame" x="0.0" y="20" width="375" height="323.5"/>
|
||||
<color key="backgroundColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<segue destination="xDh-Mk-Yo9" kind="embed" identifier="embedDeviceQRScanner" id="mve-0t-D0g"/>
|
||||
|
@ -980,7 +724,7 @@
|
|||
<viewControllerLayoutGuide type="bottom" id="s4y-gf-WU5"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="aYO-nF-lxB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="279.5"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="323.5"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
//
|
||||
// AdvancedSettingsTableViewController.h
|
||||
// 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 <UIKit/UIKit.h>
|
||||
#import "OWSTableViewController.h"
|
||||
|
||||
@interface AdvancedSettingsTableViewController : UITableViewController
|
||||
@interface AdvancedSettingsTableViewController : OWSTableViewController
|
||||
|
||||
@end
|
||||
|
|
|
@ -4,145 +4,282 @@
|
|||
|
||||
#import "AdvancedSettingsTableViewController.h"
|
||||
#import "DebugLogger.h"
|
||||
#import "DomainFrontingCountryViewController.h"
|
||||
#import "Environment.h"
|
||||
#import "OWSCountryMetadata.h"
|
||||
#import "Pastelog.h"
|
||||
#import "PropertyListPreferences.h"
|
||||
#import "PushManager.h"
|
||||
#import "Signal-Swift.h"
|
||||
#import "TSAccountManager.h"
|
||||
#import "Pastelog.h"
|
||||
#import <Reachability/Reachability.h>
|
||||
#import <SignalServiceKit/OWSSignalService.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface AdvancedSettingsTableViewController ()
|
||||
|
||||
@property (nonatomic) UITableViewCell *enableLogCell;
|
||||
@property (nonatomic) UITableViewCell *submitLogCell;
|
||||
@property (nonatomic) UITableViewCell *registerPushCell;
|
||||
|
||||
@property (nonatomic) UISwitch *enableLogSwitch;
|
||||
@property (nonatomic, readonly) BOOL supportsCallKit;
|
||||
|
||||
@property (nonatomic) UISwitch *enableCensorshipCircumventionSwitch;
|
||||
|
||||
@property (nonatomic) Reachability *reachability;
|
||||
|
||||
@end
|
||||
|
||||
typedef NS_ENUM(NSInteger, AdvancedSettingsTableViewControllerSection) {
|
||||
AdvancedSettingsTableViewControllerSectionLogging,
|
||||
AdvancedSettingsTableViewControllerSectionPushNotifications,
|
||||
AdvancedSettingsTableViewControllerSection_Count // meta section
|
||||
};
|
||||
#pragma mark -
|
||||
|
||||
@implementation AdvancedSettingsTableViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self.navigationController.navigationBar setTranslucent:NO];
|
||||
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
return [super initWithStyle:UITableViewStyleGrouped];
|
||||
}
|
||||
|
||||
- (void)loadView
|
||||
{
|
||||
[super loadView];
|
||||
|
||||
self.title = NSLocalizedString(@"SETTINGS_ADVANCED_TITLE", @"");
|
||||
|
||||
// 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 = [UISwitch new];
|
||||
[self.enableLogSwitch setOn:[PropertyListPreferences loggingIsEnabled]];
|
||||
[self.enableLogSwitch addTarget:self
|
||||
action:@selector(didToggleEnableLogSwitch:)
|
||||
forControlEvents:UIControlEventValueChanged];
|
||||
self.enableLogCell.accessoryView = self.enableLogSwitch;
|
||||
|
||||
// Send Log
|
||||
self.submitLogCell = [[UITableViewCell alloc] init];
|
||||
self.submitLogCell.textLabel.text = NSLocalizedString(@"SETTINGS_ADVANCED_SUBMIT_DEBUGLOG", @"");
|
||||
self.enableCensorshipCircumventionSwitch = [UISwitch new];
|
||||
[self.enableCensorshipCircumventionSwitch addTarget:self
|
||||
action:@selector(didToggleEnableCensorshipCircumventionSwitch:)
|
||||
forControlEvents:UIControlEventValueChanged];
|
||||
|
||||
self.registerPushCell = [[UITableViewCell alloc] init];
|
||||
self.registerPushCell.textLabel.text = NSLocalizedString(@"REREGISTER_FOR_PUSH", nil);
|
||||
self.reachability = [Reachability reachabilityForInternetConnection];
|
||||
|
||||
[self observeNotifications];
|
||||
|
||||
[self updateTableContents];
|
||||
}
|
||||
|
||||
#pragma mark - Table view data source
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return AdvancedSettingsTableViewControllerSection_Count;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
|
||||
AdvancedSettingsTableViewControllerSection settingsSection = (AdvancedSettingsTableViewControllerSection)section;
|
||||
switch (settingsSection) {
|
||||
case AdvancedSettingsTableViewControllerSectionLogging:
|
||||
return self.enableLogSwitch.isOn ? 2 : 1;
|
||||
case AdvancedSettingsTableViewControllerSectionPushNotifications:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
- (nullable NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
|
||||
- (void)observeNotifications
|
||||
{
|
||||
AdvancedSettingsTableViewControllerSection settingsSection = (AdvancedSettingsTableViewControllerSection)section;
|
||||
switch (settingsSection) {
|
||||
case AdvancedSettingsTableViewControllerSectionLogging:
|
||||
return NSLocalizedString(@"LOGGING_SECTION", nil);
|
||||
case AdvancedSettingsTableViewControllerSectionPushNotifications:
|
||||
return NSLocalizedString(@"PUSH_REGISTER_TITLE", @"Used in table section header and alert view title contexts");
|
||||
default:
|
||||
return nil;
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(socketStateDidChange)
|
||||
name:kNSNotification_SocketManagerStateDidChange
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(reachabilityChanged)
|
||||
name:kReachabilityChangedNotification
|
||||
object:nil];
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
- (void)dealloc
|
||||
{
|
||||
AdvancedSettingsTableViewControllerSection settingsSection = (AdvancedSettingsTableViewControllerSection)indexPath.section;
|
||||
switch (settingsSection) {
|
||||
case AdvancedSettingsTableViewControllerSectionLogging:
|
||||
switch (indexPath.row) {
|
||||
case 0:
|
||||
return self.enableLogCell;
|
||||
case 1:
|
||||
OWSAssert(self.enableLogSwitch.isOn);
|
||||
return self.submitLogCell;
|
||||
}
|
||||
case AdvancedSettingsTableViewControllerSectionPushNotifications:
|
||||
return self.registerPushCell;
|
||||
default:
|
||||
// Unknown section
|
||||
OWSAssert(NO);
|
||||
return nil;
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
- (void)socketStateDidChange
|
||||
{
|
||||
OWSAssert([NSThread isMainThread]);
|
||||
|
||||
if ([tableView cellForRowAtIndexPath:indexPath] == self.submitLogCell) {
|
||||
DDLogInfo(@"%@ Submitting debug logs", self.tag);
|
||||
[DDLog flushLog];
|
||||
[Pastelog submitLogs];
|
||||
} else if ([tableView cellForRowAtIndexPath:indexPath] == self.registerPushCell) {
|
||||
OWSSyncPushTokensJob *job =
|
||||
[[OWSSyncPushTokensJob alloc] initWithPushManager:[PushManager sharedManager]
|
||||
accountManager:[Environment getCurrent].accountManager
|
||||
preferences:[Environment preferences]
|
||||
showAlerts:YES];
|
||||
job.uploadOnlyIfStale = NO;
|
||||
[job run];
|
||||
[self updateTableContents];
|
||||
}
|
||||
|
||||
- (void)reachabilityChanged
|
||||
{
|
||||
OWSAssert([NSThread isMainThread]);
|
||||
|
||||
[self updateTableContents];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
[self updateTableContents];
|
||||
}
|
||||
|
||||
#pragma mark - Table Contents
|
||||
|
||||
- (void)updateTableContents
|
||||
{
|
||||
OWSTableContents *contents = [OWSTableContents new];
|
||||
|
||||
__weak AdvancedSettingsTableViewController *weakSelf = self;
|
||||
|
||||
OWSTableSection *loggingSection = [OWSTableSection new];
|
||||
loggingSection.headerTitle = NSLocalizedString(@"LOGGING_SECTION", nil);
|
||||
[loggingSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
||||
UITableViewCell *cell = [UITableViewCell new];
|
||||
cell.textLabel.text = NSLocalizedString(@"SETTINGS_ADVANCED_DEBUGLOG", @"");
|
||||
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
|
||||
cell.textLabel.textColor = [UIColor blackColor];
|
||||
|
||||
cell.accessoryView = self.enableLogSwitch;
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
return cell;
|
||||
}
|
||||
actionBlock:nil]];
|
||||
if (self.enableLogSwitch.isOn) {
|
||||
[loggingSection
|
||||
addItem:[OWSTableItem actionItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_SUBMIT_DEBUGLOG", @"")
|
||||
actionBlock:^{
|
||||
DDLogInfo(@"%@ Submitting debug logs", self.tag);
|
||||
[DDLog flushLog];
|
||||
[Pastelog submitLogs];
|
||||
}]];
|
||||
}
|
||||
|
||||
[contents addSection:loggingSection];
|
||||
|
||||
OWSTableSection *pushNotificationsSection = [OWSTableSection new];
|
||||
pushNotificationsSection.headerTitle
|
||||
= NSLocalizedString(@"PUSH_REGISTER_TITLE", @"Used in table section header and alert view title contexts");
|
||||
[pushNotificationsSection addItem:[OWSTableItem actionItemWithText:NSLocalizedString(@"REREGISTER_FOR_PUSH", nil)
|
||||
actionBlock:^{
|
||||
[weakSelf syncPushTokens];
|
||||
}]];
|
||||
[contents addSection:pushNotificationsSection];
|
||||
|
||||
// Censorship circumvention has certain disadvantages so it should only be
|
||||
// used if necessary. Therefore:
|
||||
//
|
||||
// * We disable this setting if the user has a phone number from a censored region -
|
||||
// censorship circumvention will be auto-activated for this user.
|
||||
// * We disable this setting if the user is already connected; they're not being
|
||||
// censored.
|
||||
// * We continue to show this setting so long as it is set to allow users to disable
|
||||
// it, for example when they leave a censored region.
|
||||
OWSTableSection *censorshipSection = [OWSTableSection new];
|
||||
censorshipSection.headerTitle = NSLocalizedString(@"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_HEADER",
|
||||
@"Table header for the 'censorship circumvention' section.");
|
||||
if (OWSSignalService.sharedInstance.hasCensoredPhoneNumber) {
|
||||
censorshipSection.footerTitle
|
||||
= NSLocalizedString(@"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_FOOTER_AUTO_ENABLED",
|
||||
@"Table footer for the 'censorship circumvention' section shown when censorship circumvention has been "
|
||||
@"auto-enabled based on local phone number.");
|
||||
} else if ([TSSocketManager sharedManager].state == SocketManagerStateOpen) {
|
||||
censorshipSection.footerTitle
|
||||
= NSLocalizedString(@"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_FOOTER_WEBSOCKET_CONNECTED",
|
||||
@"Table footer for the 'censorship circumvention' section shown when the app is connected to the "
|
||||
@"Signal service.");
|
||||
} else if (!self.reachability.isReachable) {
|
||||
censorshipSection.footerTitle
|
||||
= NSLocalizedString(@"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_FOOTER_NO_CONNECTION",
|
||||
@"Table footer for the 'censorship circumvention' section shown when the app is not connected to the "
|
||||
@"internet.");
|
||||
} else {
|
||||
DDLogDebug(@"%@ Ignoring cell selection at indexPath: %@", self.tag, indexPath);
|
||||
censorshipSection.footerTitle = NSLocalizedString(@"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_FOOTER",
|
||||
@"Table footer for the 'censorship circumvention' section when censorship circumvention can be manually "
|
||||
@"enabled.");
|
||||
}
|
||||
[censorshipSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
||||
UITableViewCell *cell = [UITableViewCell new];
|
||||
cell.textLabel.text = NSLocalizedString(
|
||||
@"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION", @"Label for the 'manual censorship circumvention' switch.");
|
||||
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
|
||||
cell.textLabel.textColor = [UIColor blackColor];
|
||||
|
||||
// Do enable if :
|
||||
//
|
||||
// * ...Censorship circumvention is already manually enabled (to allow users to disable it).
|
||||
//
|
||||
// Otherwise, don't enable if:
|
||||
//
|
||||
// * ...Censorship circumvention is already enabled based on the local phone number.
|
||||
// * ...The websocket is connected, since that demonstrates that no censorship is in effect.
|
||||
// * ...The internet is not reachable, since we don't want to let users to activate
|
||||
// censorship circumvention unnecessarily, e.g. if they just don't have a valid
|
||||
// internet connection.
|
||||
BOOL shouldEnable = (OWSSignalService.sharedInstance.isCensorshipCircumventionManuallyActivated
|
||||
|| (!OWSSignalService.sharedInstance.hasCensoredPhoneNumber &&
|
||||
[TSSocketManager sharedManager].state != SocketManagerStateOpen
|
||||
&& weakSelf.reachability.isReachable));
|
||||
weakSelf.enableCensorshipCircumventionSwitch.enabled = shouldEnable;
|
||||
if (OWSSignalService.sharedInstance.hasCensoredPhoneNumber) {
|
||||
[weakSelf.enableCensorshipCircumventionSwitch setOn:YES];
|
||||
} else {
|
||||
[weakSelf.enableCensorshipCircumventionSwitch
|
||||
setOn:OWSSignalService.sharedInstance.isCensorshipCircumventionManuallyActivated];
|
||||
}
|
||||
|
||||
cell.accessoryView = weakSelf.enableCensorshipCircumventionSwitch;
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
return cell;
|
||||
}
|
||||
actionBlock:nil]];
|
||||
|
||||
if (OWSSignalService.sharedInstance.isCensorshipCircumventionManuallyActivated) {
|
||||
[censorshipSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
||||
OWSCountryMetadata *manualCensorshipCircumventionCountry =
|
||||
[weakSelf ensureManualCensorshipCircumventionCountry];
|
||||
OWSAssert(manualCensorshipCircumventionCountry);
|
||||
|
||||
UITableViewCell *cell = [UITableViewCell new];
|
||||
cell.textLabel.text = [NSString
|
||||
stringWithFormat:NSLocalizedString(@"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_COUNTRY_FORMAT",
|
||||
@"Label for the 'manual censorship circumvention' country. Embeds {{the manual "
|
||||
@"censorship circumvention country}}."),
|
||||
manualCensorshipCircumventionCountry.localizedCountryName];
|
||||
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
|
||||
cell.textLabel.textColor = [UIColor blackColor];
|
||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||
return cell;
|
||||
}
|
||||
actionBlock:^{
|
||||
[weakSelf showDomainFrontingCountryView];
|
||||
}]];
|
||||
}
|
||||
[contents addSection:censorshipSection];
|
||||
|
||||
self.contents = contents;
|
||||
}
|
||||
|
||||
- (void)showDomainFrontingCountryView
|
||||
{
|
||||
DomainFrontingCountryViewController *vc = [DomainFrontingCountryViewController new];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
- (OWSCountryMetadata *)ensureManualCensorshipCircumventionCountry
|
||||
{
|
||||
OWSAssert([NSThread isMainThread]);
|
||||
|
||||
OWSCountryMetadata *countryMetadata = nil;
|
||||
NSString *countryCode = OWSSignalService.sharedInstance.manualCensorshipCircumventionCountryCode;
|
||||
if (countryCode) {
|
||||
countryMetadata = [OWSCountryMetadata countryMetadataForCountryCode:countryCode];
|
||||
}
|
||||
|
||||
if (!countryMetadata) {
|
||||
countryCode = [NSLocale.currentLocale objectForKey:NSLocaleCountryCode];
|
||||
if (countryCode) {
|
||||
countryMetadata = [OWSCountryMetadata countryMetadataForCountryCode:countryCode];
|
||||
}
|
||||
}
|
||||
|
||||
if (!countryMetadata) {
|
||||
countryCode = @"US";
|
||||
countryMetadata = [OWSCountryMetadata countryMetadataForCountryCode:countryCode];
|
||||
OWSAssert(countryMetadata);
|
||||
}
|
||||
|
||||
if (countryMetadata) {
|
||||
// Ensure the "manual censorship circumvention" country state is in sync.
|
||||
OWSSignalService.sharedInstance.manualCensorshipCircumventionCountryCode = countryCode;
|
||||
OWSSignalService.sharedInstance.manualCensorshipCircumventionDomain = countryMetadata.googleDomain;
|
||||
}
|
||||
|
||||
return countryMetadata;
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
|
||||
- (void)syncPushTokens
|
||||
{
|
||||
OWSSyncPushTokensJob *job =
|
||||
[[OWSSyncPushTokensJob alloc] initWithPushManager:[PushManager sharedManager]
|
||||
accountManager:[Environment getCurrent].accountManager
|
||||
preferences:[Environment preferences]
|
||||
showAlerts:YES];
|
||||
job.uploadOnlyIfStale = NO;
|
||||
[job run];
|
||||
}
|
||||
|
||||
- (void)didToggleEnableLogSwitch:(UISwitch *)sender {
|
||||
if (!sender.isOn) {
|
||||
[[DebugLogger sharedLogger] wipeLogs];
|
||||
|
@ -152,7 +289,15 @@ typedef NS_ENUM(NSInteger, AdvancedSettingsTableViewControllerSection) {
|
|||
}
|
||||
|
||||
[PropertyListPreferences setLoggingEnabled:sender.isOn];
|
||||
[self.tableView reloadData];
|
||||
|
||||
[self updateTableContents];
|
||||
}
|
||||
|
||||
- (void)didToggleEnableCensorshipCircumventionSwitch:(UISwitch *)sender
|
||||
{
|
||||
OWSSignalService.sharedInstance.isCensorshipCircumventionManuallyActivated = sender.isOn;
|
||||
|
||||
[self updateTableContents];
|
||||
}
|
||||
|
||||
#pragma mark - Logging
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
//
|
||||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface DomainFrontingCountryViewController : UIViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
109
Signal/src/ViewControllers/DomainFrontingCountryViewController.m
Normal file
109
Signal/src/ViewControllers/DomainFrontingCountryViewController.m
Normal file
|
@ -0,0 +1,109 @@
|
|||
//
|
||||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "DomainFrontingCountryViewController.h"
|
||||
#import "OWSCountryMetadata.h"
|
||||
#import "OWSTableViewController.h"
|
||||
#import "UIFont+OWS.h"
|
||||
#import "UIView+OWS.h"
|
||||
#import <SignalServiceKit/OWSSignalService.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@interface DomainFrontingCountryViewController ()
|
||||
|
||||
@property (nonatomic, readonly) OWSTableViewController *tableViewController;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@implementation DomainFrontingCountryViewController
|
||||
|
||||
- (void)loadView
|
||||
{
|
||||
[super loadView];
|
||||
|
||||
self.title = NSLocalizedString(
|
||||
@"CENSORSHIP_CIRCUMVENTION_COUNTRY_VIEW_TITLE", @"Title for the 'censorship circumvention country' view.");
|
||||
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
[self.navigationController.navigationBar setTranslucent:NO];
|
||||
|
||||
[self createViews];
|
||||
}
|
||||
|
||||
- (void)createViews
|
||||
{
|
||||
_tableViewController = [OWSTableViewController new];
|
||||
[self.view addSubview:self.tableViewController.view];
|
||||
[_tableViewController.view autoPinWidthToSuperview];
|
||||
[_tableViewController.view autoPinToTopLayoutGuideOfViewController:self withInset:0];
|
||||
[_tableViewController.view autoPinToBottomLayoutGuideOfViewController:self withInset:0];
|
||||
|
||||
[self updateTableContents];
|
||||
}
|
||||
|
||||
#pragma mark - Table Contents
|
||||
|
||||
- (void)updateTableContents
|
||||
{
|
||||
OWSTableContents *contents = [OWSTableContents new];
|
||||
|
||||
NSString *currentCountryCode = OWSSignalService.sharedInstance.manualCensorshipCircumventionCountryCode;
|
||||
|
||||
__weak DomainFrontingCountryViewController *weakSelf = self;
|
||||
|
||||
OWSTableSection *section = [OWSTableSection new];
|
||||
section.headerTitle = NSLocalizedString(
|
||||
@"DOMAIN_FRONTING_COUNTRY_VIEW_SECTION_HEADER", @"Section title for the 'domain fronting country' view.");
|
||||
for (OWSCountryMetadata *countryMetadata in [OWSCountryMetadata allCountryMetadatas]) {
|
||||
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
||||
UITableViewCell *cell = [UITableViewCell new];
|
||||
cell.textLabel.text = countryMetadata.localizedCountryName;
|
||||
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
|
||||
cell.textLabel.textColor = [UIColor blackColor];
|
||||
|
||||
if ([countryMetadata.countryCode isEqualToString:currentCountryCode]) {
|
||||
cell.accessoryType = UITableViewCellAccessoryCheckmark;
|
||||
}
|
||||
|
||||
return cell;
|
||||
}
|
||||
actionBlock:^{
|
||||
[weakSelf selectCountry:countryMetadata];
|
||||
}]];
|
||||
}
|
||||
[contents addSection:section];
|
||||
|
||||
self.tableViewController.contents = contents;
|
||||
}
|
||||
|
||||
- (void)selectCountry:(OWSCountryMetadata *)countryMetadata
|
||||
{
|
||||
OWSAssert(countryMetadata);
|
||||
|
||||
OWSSignalService.sharedInstance.manualCensorshipCircumventionCountryCode = countryMetadata.countryCode;
|
||||
OWSSignalService.sharedInstance.manualCensorshipCircumventionDomain = countryMetadata.googleDomain;
|
||||
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Logging
|
||||
|
||||
+ (NSString *)tag
|
||||
{
|
||||
return [NSString stringWithFormat:@"[%@]", self.class];
|
||||
}
|
||||
|
||||
- (NSString *)tag
|
||||
{
|
||||
return self.class.tag;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
21
Signal/src/ViewControllers/OWSCountryMetadata.h
Normal file
21
Signal/src/ViewControllers/OWSCountryMetadata.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface OWSCountryMetadata : NSObject
|
||||
|
||||
@property (nonatomic) NSString *name;
|
||||
@property (nonatomic) NSString *tld;
|
||||
@property (nonatomic) NSString *googleDomain;
|
||||
@property (nonatomic) NSString *countryCode;
|
||||
@property (nonatomic) NSString *localizedCountryName;
|
||||
|
||||
+ (OWSCountryMetadata *)countryMetadataForCountryCode:(NSString *)countryCode;
|
||||
|
||||
+ (NSArray<OWSCountryMetadata *> *)allCountryMetadatas;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
844
Signal/src/ViewControllers/OWSCountryMetadata.m
Normal file
844
Signal/src/ViewControllers/OWSCountryMetadata.m
Normal file
|
@ -0,0 +1,844 @@
|
|||
//
|
||||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OWSCountryMetadata.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSCountryMetadata
|
||||
|
||||
+ (OWSCountryMetadata *)countryMetadataWithName:(NSString *)name
|
||||
tld:(NSString *)tld
|
||||
googleDomain:(NSString *)googleDomain
|
||||
countryCode:(NSString *)countryCode
|
||||
{
|
||||
OWSAssert(name.length > 0);
|
||||
OWSAssert(tld.length > 0);
|
||||
OWSAssert(googleDomain.length > 0);
|
||||
OWSAssert(countryCode.length > 0);
|
||||
|
||||
OWSCountryMetadata *instance = [OWSCountryMetadata new];
|
||||
instance.name = name;
|
||||
instance.tld = tld;
|
||||
instance.googleDomain = googleDomain;
|
||||
instance.countryCode = countryCode;
|
||||
|
||||
NSString *localizedCountryName = [[NSLocale currentLocale] localizedStringForCountryCode:countryCode];
|
||||
if (localizedCountryName.length < 1) {
|
||||
localizedCountryName = name;
|
||||
}
|
||||
instance.localizedCountryName = localizedCountryName;
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
+ (OWSCountryMetadata *)countryMetadataForCountryCode:(NSString *)countryCode
|
||||
{
|
||||
OWSAssert(countryCode.length > 0);
|
||||
|
||||
return [self countryCodeToCountryMetadataMap][countryCode];
|
||||
}
|
||||
|
||||
+ (NSDictionary<NSString *, OWSCountryMetadata *> *)countryCodeToCountryMetadataMap
|
||||
{
|
||||
static NSDictionary<NSString *, OWSCountryMetadata *> *cachedValue = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
NSMutableDictionary<NSString *, OWSCountryMetadata *> *map = [NSMutableDictionary new];
|
||||
for (OWSCountryMetadata *metadata in [self allCountryMetadatas]) {
|
||||
map[metadata.countryCode] = metadata;
|
||||
}
|
||||
cachedValue = map;
|
||||
});
|
||||
return cachedValue;
|
||||
}
|
||||
|
||||
+ (NSArray<OWSCountryMetadata *> *)allCountryMetadatas
|
||||
{
|
||||
static NSArray<OWSCountryMetadata *> *cachedValue = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
// This list is derived from:
|
||||
//
|
||||
// * https://en.wikipedia.org/wiki/List_of_Google_domains
|
||||
// * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
||||
cachedValue = @[
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Andorra"
|
||||
tld:@".ad"
|
||||
googleDomain:@"google.ad"
|
||||
countryCode:@"AD"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"United Arab Emirates"
|
||||
tld:@".ae"
|
||||
googleDomain:@"google.ae"
|
||||
countryCode:@"AE"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Afghanistan"
|
||||
tld:@".af"
|
||||
googleDomain:@"google.com.af"
|
||||
countryCode:@"AF"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Antigua and Barbuda"
|
||||
tld:@".ag"
|
||||
googleDomain:@"google.com.ag"
|
||||
countryCode:@"AG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Anguilla"
|
||||
tld:@".ai"
|
||||
googleDomain:@"google.com.ai"
|
||||
countryCode:@"AI"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Albania"
|
||||
tld:@".al"
|
||||
googleDomain:@"google.al"
|
||||
countryCode:@"AL"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Armenia"
|
||||
tld:@".am"
|
||||
googleDomain:@"google.am"
|
||||
countryCode:@"AM"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Angola"
|
||||
tld:@".ao"
|
||||
googleDomain:@"google.co.ao"
|
||||
countryCode:@"AO"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Argentina"
|
||||
tld:@".ar"
|
||||
googleDomain:@"google.com.ar"
|
||||
countryCode:@"AR"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"American Samoa"
|
||||
tld:@".as"
|
||||
googleDomain:@"google.as"
|
||||
countryCode:@"AS"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Austria"
|
||||
tld:@".at"
|
||||
googleDomain:@"google.at"
|
||||
countryCode:@"AT"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Australia"
|
||||
tld:@".au"
|
||||
googleDomain:@"google.com.au"
|
||||
countryCode:@"AU"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Azerbaijan"
|
||||
tld:@".az"
|
||||
googleDomain:@"google.az"
|
||||
countryCode:@"AZ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Bosnia and Herzegovina"
|
||||
tld:@".ba"
|
||||
googleDomain:@"google.ba"
|
||||
countryCode:@"BA"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Bangladesh"
|
||||
tld:@".bd"
|
||||
googleDomain:@"google.com.bd"
|
||||
countryCode:@"BD"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Belgium"
|
||||
tld:@".be"
|
||||
googleDomain:@"google.be"
|
||||
countryCode:@"BE"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Burkina Faso"
|
||||
tld:@".bf"
|
||||
googleDomain:@"google.bf"
|
||||
countryCode:@"BF"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Bulgaria"
|
||||
tld:@".bg"
|
||||
googleDomain:@"google.bg"
|
||||
countryCode:@"BG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Bahrain"
|
||||
tld:@".bh"
|
||||
googleDomain:@"google.com.bh"
|
||||
countryCode:@"BH"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Burundi"
|
||||
tld:@".bi"
|
||||
googleDomain:@"google.bi"
|
||||
countryCode:@"BI"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Benin"
|
||||
tld:@".bj"
|
||||
googleDomain:@"google.bj"
|
||||
countryCode:@"BJ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Brunei"
|
||||
tld:@".bn"
|
||||
googleDomain:@"google.com.bn"
|
||||
countryCode:@"BN"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Bolivia"
|
||||
tld:@".bo"
|
||||
googleDomain:@"google.com.bo"
|
||||
countryCode:@"BO"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Brazil"
|
||||
tld:@".br"
|
||||
googleDomain:@"google.com.br"
|
||||
countryCode:@"BR"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Bahamas"
|
||||
tld:@".bs"
|
||||
googleDomain:@"google.bs"
|
||||
countryCode:@"BS"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Bhutan"
|
||||
tld:@".bt"
|
||||
googleDomain:@"google.bt"
|
||||
countryCode:@"BT"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Botswana"
|
||||
tld:@".bw"
|
||||
googleDomain:@"google.co.bw"
|
||||
countryCode:@"BW"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Belarus"
|
||||
tld:@".by"
|
||||
googleDomain:@"google.by"
|
||||
countryCode:@"BY"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Belize"
|
||||
tld:@".bz"
|
||||
googleDomain:@"google.com.bz"
|
||||
countryCode:@"BZ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Canada"
|
||||
tld:@".ca"
|
||||
googleDomain:@"google.ca"
|
||||
countryCode:@"CA"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Cambodia"
|
||||
tld:@".kh"
|
||||
googleDomain:@"google.com.kh"
|
||||
countryCode:@"KH"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Cocos (Keeling) Islands"
|
||||
tld:@".cc"
|
||||
googleDomain:@"google.cc"
|
||||
countryCode:@"CC"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Democratic Republic of the Congo"
|
||||
tld:@".cd"
|
||||
googleDomain:@"google.cd"
|
||||
countryCode:@"CD"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Central African Republic"
|
||||
tld:@".cf"
|
||||
googleDomain:@"google.cf"
|
||||
countryCode:@"CF"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Republic of the Congo"
|
||||
tld:@".cg"
|
||||
googleDomain:@"google.cg"
|
||||
countryCode:@"CG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Switzerland"
|
||||
tld:@".ch"
|
||||
googleDomain:@"google.ch"
|
||||
countryCode:@"CH"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Ivory Coast"
|
||||
tld:@".ci"
|
||||
googleDomain:@"google.ci"
|
||||
countryCode:@"CI"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Cook Islands"
|
||||
tld:@".ck"
|
||||
googleDomain:@"google.co.ck"
|
||||
countryCode:@"CK"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Chile"
|
||||
tld:@".cl"
|
||||
googleDomain:@"google.cl"
|
||||
countryCode:@"CL"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Cameroon"
|
||||
tld:@".cm"
|
||||
googleDomain:@"google.cm"
|
||||
countryCode:@"CM"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"China"
|
||||
tld:@".cn"
|
||||
googleDomain:@"google.cn"
|
||||
countryCode:@"CN"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Colombia"
|
||||
tld:@".co"
|
||||
googleDomain:@"google.co"
|
||||
countryCode:@"CO"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Costa Rica"
|
||||
tld:@".cr"
|
||||
googleDomain:@"google.co.cr"
|
||||
countryCode:@"CR"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Cuba"
|
||||
tld:@".cu"
|
||||
googleDomain:@"google.com.cu"
|
||||
countryCode:@"CU"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Cape Verde"
|
||||
tld:@".cv"
|
||||
googleDomain:@"google.cv"
|
||||
countryCode:@"CV"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Christmas Island"
|
||||
tld:@".cx"
|
||||
googleDomain:@"google.cx"
|
||||
countryCode:@"CX"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Cyprus"
|
||||
tld:@".cy"
|
||||
googleDomain:@"google.com.cy"
|
||||
countryCode:@"CY"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Czech Republic"
|
||||
tld:@".cz"
|
||||
googleDomain:@"google.cz"
|
||||
countryCode:@"CZ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Germany"
|
||||
tld:@".de"
|
||||
googleDomain:@"google.de"
|
||||
countryCode:@"DE"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Djibouti"
|
||||
tld:@".dj"
|
||||
googleDomain:@"google.dj"
|
||||
countryCode:@"DJ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Denmark"
|
||||
tld:@".dk"
|
||||
googleDomain:@"google.dk"
|
||||
countryCode:@"DK"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Dominica"
|
||||
tld:@".dm"
|
||||
googleDomain:@"google.dm"
|
||||
countryCode:@"DM"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Dominican Republic"
|
||||
tld:@".do"
|
||||
googleDomain:@"google.com.do"
|
||||
countryCode:@"DO"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Algeria"
|
||||
tld:@".dz"
|
||||
googleDomain:@"google.dz"
|
||||
countryCode:@"DZ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Ecuador"
|
||||
tld:@".ec"
|
||||
googleDomain:@"google.com.ec"
|
||||
countryCode:@"EC"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Estonia"
|
||||
tld:@".ee"
|
||||
googleDomain:@"google.ee"
|
||||
countryCode:@"EE"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Egypt"
|
||||
tld:@".eg"
|
||||
googleDomain:@"google.com.eg"
|
||||
countryCode:@"EG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Spain"
|
||||
tld:@".es"
|
||||
googleDomain:@"google.es"
|
||||
countryCode:@"ES"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Ethiopia"
|
||||
tld:@".et"
|
||||
googleDomain:@"google.com.et"
|
||||
countryCode:@"ET"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Finland"
|
||||
tld:@".fi"
|
||||
googleDomain:@"google.fi"
|
||||
countryCode:@"FI"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Fiji"
|
||||
tld:@".fj"
|
||||
googleDomain:@"google.com.fj"
|
||||
countryCode:@"FJ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Federated States of Micronesia"
|
||||
tld:@".fm"
|
||||
googleDomain:@"google.fm"
|
||||
countryCode:@"FM"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"France"
|
||||
tld:@".fr"
|
||||
googleDomain:@"google.fr"
|
||||
countryCode:@"FR"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Gabon"
|
||||
tld:@".ga"
|
||||
googleDomain:@"google.ga"
|
||||
countryCode:@"GA"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Georgia"
|
||||
tld:@".ge"
|
||||
googleDomain:@"google.ge"
|
||||
countryCode:@"GE"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"French Guiana"
|
||||
tld:@".gf"
|
||||
googleDomain:@"google.gf"
|
||||
countryCode:@"GF"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Guernsey"
|
||||
tld:@".gg"
|
||||
googleDomain:@"google.gg"
|
||||
countryCode:@"GG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Ghana"
|
||||
tld:@".gh"
|
||||
googleDomain:@"google.com.gh"
|
||||
countryCode:@"GH"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Gibraltar"
|
||||
tld:@".gi"
|
||||
googleDomain:@"google.com.gi"
|
||||
countryCode:@"GI"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Greenland"
|
||||
tld:@".gl"
|
||||
googleDomain:@"google.gl"
|
||||
countryCode:@"GL"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Gambia"
|
||||
tld:@".gm"
|
||||
googleDomain:@"google.gm"
|
||||
countryCode:@"GM"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Guadeloupe"
|
||||
tld:@".gp"
|
||||
googleDomain:@"google.gp"
|
||||
countryCode:@"GP"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Greece"
|
||||
tld:@".gr"
|
||||
googleDomain:@"google.gr"
|
||||
countryCode:@"GR"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Guatemala"
|
||||
tld:@".gt"
|
||||
googleDomain:@"google.com.gt"
|
||||
countryCode:@"GT"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Guyana"
|
||||
tld:@".gy"
|
||||
googleDomain:@"google.gy"
|
||||
countryCode:@"GY"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Hong Kong"
|
||||
tld:@".hk"
|
||||
googleDomain:@"google.com.hk"
|
||||
countryCode:@"HK"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Honduras"
|
||||
tld:@".hn"
|
||||
googleDomain:@"google.hn"
|
||||
countryCode:@"HN"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Croatia"
|
||||
tld:@".hr"
|
||||
googleDomain:@"google.hr"
|
||||
countryCode:@"HR"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Haiti"
|
||||
tld:@".ht"
|
||||
googleDomain:@"google.ht"
|
||||
countryCode:@"HT"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Hungary"
|
||||
tld:@".hu"
|
||||
googleDomain:@"google.hu"
|
||||
countryCode:@"HU"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Indonesia"
|
||||
tld:@".id"
|
||||
googleDomain:@"google.co.id"
|
||||
countryCode:@"ID"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Iraq" tld:@".iq" googleDomain:@"google.iq" countryCode:@"IQ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Ireland"
|
||||
tld:@".ie"
|
||||
googleDomain:@"google.ie"
|
||||
countryCode:@"IE"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Israel"
|
||||
tld:@".il"
|
||||
googleDomain:@"google.co.il"
|
||||
countryCode:@"IL"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Isle of Man"
|
||||
tld:@".im"
|
||||
googleDomain:@"google.im"
|
||||
countryCode:@"IM"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"India"
|
||||
tld:@".in"
|
||||
googleDomain:@"google.co.in"
|
||||
countryCode:@"IN"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"British Indian Ocean Territory"
|
||||
tld:@".io"
|
||||
googleDomain:@"google.io"
|
||||
countryCode:@"IO"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Iceland"
|
||||
tld:@".is"
|
||||
googleDomain:@"google.is"
|
||||
countryCode:@"IS"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Italy"
|
||||
tld:@".it"
|
||||
googleDomain:@"google.it"
|
||||
countryCode:@"IT"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Jersey"
|
||||
tld:@".je"
|
||||
googleDomain:@"google.je"
|
||||
countryCode:@"JE"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Jamaica"
|
||||
tld:@".jm"
|
||||
googleDomain:@"google.com.jm"
|
||||
countryCode:@"JM"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Jordan"
|
||||
tld:@".jo"
|
||||
googleDomain:@"google.jo"
|
||||
countryCode:@"JO"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Japan"
|
||||
tld:@".jp"
|
||||
googleDomain:@"google.co.jp"
|
||||
countryCode:@"JP"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Kenya"
|
||||
tld:@".ke"
|
||||
googleDomain:@"google.co.ke"
|
||||
countryCode:@"KE"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Kiribati"
|
||||
tld:@".ki"
|
||||
googleDomain:@"google.ki"
|
||||
countryCode:@"KI"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Kyrgyzstan"
|
||||
tld:@".kg"
|
||||
googleDomain:@"google.kg"
|
||||
countryCode:@"KG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"South Korea"
|
||||
tld:@".kr"
|
||||
googleDomain:@"google.co.kr"
|
||||
countryCode:@"KR"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Kuwait"
|
||||
tld:@".kw"
|
||||
googleDomain:@"google.com.kw"
|
||||
countryCode:@"KW"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Kazakhstan"
|
||||
tld:@".kz"
|
||||
googleDomain:@"google.kz"
|
||||
countryCode:@"KZ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Laos" tld:@".la" googleDomain:@"google.la" countryCode:@"LA"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Lebanon"
|
||||
tld:@".lb"
|
||||
googleDomain:@"google.com.lb"
|
||||
countryCode:@"LB"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Saint Lucia"
|
||||
tld:@".lc"
|
||||
googleDomain:@"google.com.lc"
|
||||
countryCode:@"LC"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Liechtenstein"
|
||||
tld:@".li"
|
||||
googleDomain:@"google.li"
|
||||
countryCode:@"LI"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Sri Lanka"
|
||||
tld:@".lk"
|
||||
googleDomain:@"google.lk"
|
||||
countryCode:@"LK"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Lesotho"
|
||||
tld:@".ls"
|
||||
googleDomain:@"google.co.ls"
|
||||
countryCode:@"LS"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Lithuania"
|
||||
tld:@".lt"
|
||||
googleDomain:@"google.lt"
|
||||
countryCode:@"LT"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Luxembourg"
|
||||
tld:@".lu"
|
||||
googleDomain:@"google.lu"
|
||||
countryCode:@"LU"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Latvia"
|
||||
tld:@".lv"
|
||||
googleDomain:@"google.lv"
|
||||
countryCode:@"LV"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Libya"
|
||||
tld:@".ly"
|
||||
googleDomain:@"google.com.ly"
|
||||
countryCode:@"LY"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Morocco"
|
||||
tld:@".ma"
|
||||
googleDomain:@"google.co.ma"
|
||||
countryCode:@"MA"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Moldova"
|
||||
tld:@".md"
|
||||
googleDomain:@"google.md"
|
||||
countryCode:@"MD"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Montenegro"
|
||||
tld:@".me"
|
||||
googleDomain:@"google.me"
|
||||
countryCode:@"ME"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Madagascar"
|
||||
tld:@".mg"
|
||||
googleDomain:@"google.mg"
|
||||
countryCode:@"MG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Macedonia"
|
||||
tld:@".mk"
|
||||
googleDomain:@"google.mk"
|
||||
countryCode:@"MK"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Mali" tld:@".ml" googleDomain:@"google.ml" countryCode:@"ML"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Myanmar"
|
||||
tld:@".mm"
|
||||
googleDomain:@"google.com.mm"
|
||||
countryCode:@"MM"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Mongolia"
|
||||
tld:@".mn"
|
||||
googleDomain:@"google.mn"
|
||||
countryCode:@"MN"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Montserrat"
|
||||
tld:@".ms"
|
||||
googleDomain:@"google.ms"
|
||||
countryCode:@"MS"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Malta"
|
||||
tld:@".mt"
|
||||
googleDomain:@"google.com.mt"
|
||||
countryCode:@"MT"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Mauritius"
|
||||
tld:@".mu"
|
||||
googleDomain:@"google.mu"
|
||||
countryCode:@"MU"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Maldives"
|
||||
tld:@".mv"
|
||||
googleDomain:@"google.mv"
|
||||
countryCode:@"MV"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Malawi"
|
||||
tld:@".mw"
|
||||
googleDomain:@"google.mw"
|
||||
countryCode:@"MW"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Mexico"
|
||||
tld:@".mx"
|
||||
googleDomain:@"google.com.mx"
|
||||
countryCode:@"MX"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Malaysia"
|
||||
tld:@".my"
|
||||
googleDomain:@"google.com.my"
|
||||
countryCode:@"MY"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Mozambique"
|
||||
tld:@".mz"
|
||||
googleDomain:@"google.co.mz"
|
||||
countryCode:@"MZ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Namibia"
|
||||
tld:@".na"
|
||||
googleDomain:@"google.com.na"
|
||||
countryCode:@"NA"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Niger"
|
||||
tld:@".ne"
|
||||
googleDomain:@"google.ne"
|
||||
countryCode:@"NE"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Norfolk Island"
|
||||
tld:@".nf"
|
||||
googleDomain:@"google.nf"
|
||||
countryCode:@"NF"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Nigeria"
|
||||
tld:@".ng"
|
||||
googleDomain:@"google.com.ng"
|
||||
countryCode:@"NG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Nicaragua"
|
||||
tld:@".ni"
|
||||
googleDomain:@"google.com.ni"
|
||||
countryCode:@"NI"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Netherlands"
|
||||
tld:@".nl"
|
||||
googleDomain:@"google.nl"
|
||||
countryCode:@"NL"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Norway"
|
||||
tld:@".no"
|
||||
googleDomain:@"google.no"
|
||||
countryCode:@"NO"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Nepal"
|
||||
tld:@".np"
|
||||
googleDomain:@"google.com.np"
|
||||
countryCode:@"NP"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Nauru"
|
||||
tld:@".nr"
|
||||
googleDomain:@"google.nr"
|
||||
countryCode:@"NR"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Niue" tld:@".nu" googleDomain:@"google.nu" countryCode:@"NU"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"New Zealand"
|
||||
tld:@".nz"
|
||||
googleDomain:@"google.co.nz"
|
||||
countryCode:@"NZ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Oman"
|
||||
tld:@".om"
|
||||
googleDomain:@"google.com.om"
|
||||
countryCode:@"OM"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Pakistan"
|
||||
tld:@".pk"
|
||||
googleDomain:@"google.com.pk"
|
||||
countryCode:@"PK"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Panama"
|
||||
tld:@".pa"
|
||||
googleDomain:@"google.com.pa"
|
||||
countryCode:@"PA"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Peru"
|
||||
tld:@".pe"
|
||||
googleDomain:@"google.com.pe"
|
||||
countryCode:@"PE"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Philippines"
|
||||
tld:@".ph"
|
||||
googleDomain:@"google.com.ph"
|
||||
countryCode:@"PH"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Poland"
|
||||
tld:@".pl"
|
||||
googleDomain:@"google.pl"
|
||||
countryCode:@"PL"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Papua New Guinea"
|
||||
tld:@".pg"
|
||||
googleDomain:@"google.com.pg"
|
||||
countryCode:@"PG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Pitcairn Islands"
|
||||
tld:@".pn"
|
||||
googleDomain:@"google.pn"
|
||||
countryCode:@"PN"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Puerto Rico"
|
||||
tld:@".pr"
|
||||
googleDomain:@"google.com.pr"
|
||||
countryCode:@"PR"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Palestine[4]"
|
||||
tld:@".ps"
|
||||
googleDomain:@"google.ps"
|
||||
countryCode:@"PS"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Portugal"
|
||||
tld:@".pt"
|
||||
googleDomain:@"google.pt"
|
||||
countryCode:@"PT"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Paraguay"
|
||||
tld:@".py"
|
||||
googleDomain:@"google.com.py"
|
||||
countryCode:@"PY"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Qatar"
|
||||
tld:@".qa"
|
||||
googleDomain:@"google.com.qa"
|
||||
countryCode:@"QA"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Romania"
|
||||
tld:@".ro"
|
||||
googleDomain:@"google.ro"
|
||||
countryCode:@"RO"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Serbia"
|
||||
tld:@".rs"
|
||||
googleDomain:@"google.rs"
|
||||
countryCode:@"RS"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Russia"
|
||||
tld:@".ru"
|
||||
googleDomain:@"google.ru"
|
||||
countryCode:@"RU"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Rwanda"
|
||||
tld:@".rw"
|
||||
googleDomain:@"google.rw"
|
||||
countryCode:@"RW"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Saudi Arabia"
|
||||
tld:@".sa"
|
||||
googleDomain:@"google.com.sa"
|
||||
countryCode:@"SA"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Solomon Islands"
|
||||
tld:@".sb"
|
||||
googleDomain:@"google.com.sb"
|
||||
countryCode:@"SB"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Seychelles"
|
||||
tld:@".sc"
|
||||
googleDomain:@"google.sc"
|
||||
countryCode:@"SC"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Sweden"
|
||||
tld:@".se"
|
||||
googleDomain:@"google.se"
|
||||
countryCode:@"SE"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Singapore"
|
||||
tld:@".sg"
|
||||
googleDomain:@"google.com.sg"
|
||||
countryCode:@"SG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Saint Helena, Ascension and Tristan da Cunha"
|
||||
tld:@".sh"
|
||||
googleDomain:@"google.sh"
|
||||
countryCode:@"SH"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Slovenia"
|
||||
tld:@".si"
|
||||
googleDomain:@"google.si"
|
||||
countryCode:@"SI"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Slovakia"
|
||||
tld:@".sk"
|
||||
googleDomain:@"google.sk"
|
||||
countryCode:@"SK"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Sierra Leone"
|
||||
tld:@".sl"
|
||||
googleDomain:@"google.com.sl"
|
||||
countryCode:@"SL"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Senegal"
|
||||
tld:@".sn"
|
||||
googleDomain:@"google.sn"
|
||||
countryCode:@"SN"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"San Marino"
|
||||
tld:@".sm"
|
||||
googleDomain:@"google.sm"
|
||||
countryCode:@"SM"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Somalia"
|
||||
tld:@".so"
|
||||
googleDomain:@"google.so"
|
||||
countryCode:@"SO"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"São Tomé and Príncipe"
|
||||
tld:@".st"
|
||||
googleDomain:@"google.st"
|
||||
countryCode:@"ST"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Suriname"
|
||||
tld:@".sr"
|
||||
googleDomain:@"google.sr"
|
||||
countryCode:@"SR"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"El Salvador"
|
||||
tld:@".sv"
|
||||
googleDomain:@"google.com.sv"
|
||||
countryCode:@"SV"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Chad" tld:@".td" googleDomain:@"google.td" countryCode:@"TD"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Togo" tld:@".tg" googleDomain:@"google.tg" countryCode:@"TG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Thailand"
|
||||
tld:@".th"
|
||||
googleDomain:@"google.co.th"
|
||||
countryCode:@"TH"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Tajikistan"
|
||||
tld:@".tj"
|
||||
googleDomain:@"google.com.tj"
|
||||
countryCode:@"TJ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Tokelau"
|
||||
tld:@".tk"
|
||||
googleDomain:@"google.tk"
|
||||
countryCode:@"TK"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Timor-Leste"
|
||||
tld:@".tl"
|
||||
googleDomain:@"google.tl"
|
||||
countryCode:@"TL"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Turkmenistan"
|
||||
tld:@".tm"
|
||||
googleDomain:@"google.tm"
|
||||
countryCode:@"TM"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Tonga"
|
||||
tld:@".to"
|
||||
googleDomain:@"google.to"
|
||||
countryCode:@"TO"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Tunisia"
|
||||
tld:@".tn"
|
||||
googleDomain:@"google.tn"
|
||||
countryCode:@"TN"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Turkey"
|
||||
tld:@".tr"
|
||||
googleDomain:@"google.com.tr"
|
||||
countryCode:@"TR"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Trinidad and Tobago"
|
||||
tld:@".tt"
|
||||
googleDomain:@"google.tt"
|
||||
countryCode:@"TT"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Taiwan"
|
||||
tld:@".tw"
|
||||
googleDomain:@"google.com.tw"
|
||||
countryCode:@"TW"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Tanzania"
|
||||
tld:@".tz"
|
||||
googleDomain:@"google.co.tz"
|
||||
countryCode:@"TZ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Ukraine"
|
||||
tld:@".ua"
|
||||
googleDomain:@"google.com.ua"
|
||||
countryCode:@"UA"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Uganda"
|
||||
tld:@".ug"
|
||||
googleDomain:@"google.co.ug"
|
||||
countryCode:@"UG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"United States"
|
||||
tld:@".us"
|
||||
googleDomain:@"google.us"
|
||||
countryCode:@"US"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Uruguay"
|
||||
tld:@".uy"
|
||||
googleDomain:@"google.com.uy"
|
||||
countryCode:@"UY"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Uzbekistan"
|
||||
tld:@".uz"
|
||||
googleDomain:@"google.co.uz"
|
||||
countryCode:@"UZ"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Saint Vincent and the Grenadines"
|
||||
tld:@".vc"
|
||||
googleDomain:@"google.com.vc"
|
||||
countryCode:@"VC"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Venezuela"
|
||||
tld:@".ve"
|
||||
googleDomain:@"google.co.ve"
|
||||
countryCode:@"VE"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"British Virgin Islands"
|
||||
tld:@".vg"
|
||||
googleDomain:@"google.vg"
|
||||
countryCode:@"VG"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"United States Virgin Islands"
|
||||
tld:@".vi"
|
||||
googleDomain:@"google.co.vi"
|
||||
countryCode:@"VI"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Vietnam"
|
||||
tld:@".vn"
|
||||
googleDomain:@"google.com.vn"
|
||||
countryCode:@"VN"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Vanuatu"
|
||||
tld:@".vu"
|
||||
googleDomain:@"google.vu"
|
||||
countryCode:@"VU"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Samoa"
|
||||
tld:@".ws"
|
||||
googleDomain:@"google.ws"
|
||||
countryCode:@"WS"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"South Africa"
|
||||
tld:@".za"
|
||||
googleDomain:@"google.co.za"
|
||||
countryCode:@"ZA"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Zambia"
|
||||
tld:@".zm"
|
||||
googleDomain:@"google.co.zm"
|
||||
countryCode:@"ZM"],
|
||||
[OWSCountryMetadata countryMetadataWithName:@"Zimbabwe"
|
||||
tld:@".zw"
|
||||
googleDomain:@"google.co.zw"
|
||||
countryCode:@"ZW"],
|
||||
];
|
||||
cachedValue = [cachedValue sortedArrayUsingComparator:^NSComparisonResult(
|
||||
OWSCountryMetadata *_Nonnull left, OWSCountryMetadata *_Nonnull right) {
|
||||
return [left.localizedCountryName compare:right.localizedCountryName];
|
||||
}];
|
||||
});
|
||||
return cachedValue;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -64,6 +64,10 @@ typedef UITableViewCell *_Nonnull (^OWSTableCustomCellBlock)();
|
|||
+ (OWSTableItem *)itemWithCustomCellBlock:(OWSTableCustomCellBlock)customCellBlock
|
||||
actionBlock:(nullable OWSTableActionBlock)actionBlock;
|
||||
|
||||
+ (OWSTableItem *)disclosureItemWithText:(NSString *)text actionBlock:(nullable OWSTableActionBlock)actionBlock;
|
||||
|
||||
+ (OWSTableItem *)actionItemWithText:(NSString *)text actionBlock:(nullable OWSTableActionBlock)actionBlock;
|
||||
|
||||
- (nullable UITableViewCell *)customCell;
|
||||
- (NSNumber *)customRowHeight;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
//
|
||||
|
||||
#import "OWSTableViewController.h"
|
||||
#import "UIFont+OWS.h"
|
||||
#import "UIView+OWS.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
@ -149,6 +150,43 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
|
|||
return item;
|
||||
}
|
||||
|
||||
+ (OWSTableItem *)disclosureItemWithText:(NSString *)text actionBlock:(nullable OWSTableActionBlock)actionBlock
|
||||
{
|
||||
OWSAssert(text.length > 0);
|
||||
OWSAssert(actionBlock);
|
||||
|
||||
OWSTableItem *item = [OWSTableItem new];
|
||||
item.itemType = OWSTableItemTypeAction;
|
||||
item.actionBlock = actionBlock;
|
||||
item.customCellBlock = ^{
|
||||
UITableViewCell *cell = [UITableViewCell new];
|
||||
cell.textLabel.text = text;
|
||||
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
|
||||
cell.textLabel.textColor = [UIColor blackColor];
|
||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||
return cell;
|
||||
};
|
||||
return item;
|
||||
}
|
||||
|
||||
+ (OWSTableItem *)actionItemWithText:(NSString *)text actionBlock:(nullable OWSTableActionBlock)actionBlock
|
||||
{
|
||||
OWSAssert(text.length > 0);
|
||||
OWSAssert(actionBlock);
|
||||
|
||||
OWSTableItem *item = [OWSTableItem new];
|
||||
item.itemType = OWSTableItemTypeAction;
|
||||
item.actionBlock = actionBlock;
|
||||
item.customCellBlock = ^{
|
||||
UITableViewCell *cell = [UITableViewCell new];
|
||||
cell.textLabel.text = text;
|
||||
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
|
||||
cell.textLabel.textColor = [UIColor blackColor];
|
||||
return cell;
|
||||
};
|
||||
return item;
|
||||
}
|
||||
|
||||
- (nullable UITableViewCell *)customCell
|
||||
{
|
||||
if (_customCell) {
|
||||
|
|
|
@ -2,22 +2,22 @@
|
|||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "OWSTableViewController.h"
|
||||
|
||||
@interface SettingsTableViewController : UITableViewController
|
||||
@interface SettingsTableViewController : OWSTableViewController
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UILabel *registeredName;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *registeredNumber;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *networkStatusLabel;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *networkStatusHeader;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *privacyLabel;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *notificationsLabel;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *linkedDevicesLabel;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *advancedLabel;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *aboutLabel;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *inviteLabel;
|
||||
@property (strong, nonatomic) IBOutlet UIButton *destroyAccountButton;
|
||||
|
||||
- (IBAction)unregisterUser:(id)sender;
|
||||
//@property (strong, nonatomic) IBOutlet UILabel *registeredName;
|
||||
//@property (strong, nonatomic) IBOutlet UILabel *registeredNumber;
|
||||
//@property (strong, nonatomic) IBOutlet UILabel *networkStatusLabel;
|
||||
//@property (strong, nonatomic) IBOutlet UILabel *networkStatusHeader;
|
||||
//@property (strong, nonatomic) IBOutlet UILabel *privacyLabel;
|
||||
//@property (strong, nonatomic) IBOutlet UILabel *notificationsLabel;
|
||||
//@property (strong, nonatomic) IBOutlet UILabel *linkedDevicesLabel;
|
||||
//@property (strong, nonatomic) IBOutlet UILabel *advancedLabel;
|
||||
//@property (strong, nonatomic) IBOutlet UILabel *aboutLabel;
|
||||
//@property (strong, nonatomic) IBOutlet UILabel *inviteLabel;
|
||||
//@property (strong, nonatomic) IBOutlet UIButton *destroyAccountButton;
|
||||
//
|
||||
//- (IBAction)unregisterUser:(id)sender;
|
||||
|
||||
@end
|
||||
|
|
|
@ -3,48 +3,19 @@
|
|||
//
|
||||
|
||||
#import "SettingsTableViewController.h"
|
||||
#import "Environment.h"
|
||||
#import "PropertyListPreferences.h"
|
||||
#import "TSAccountManager.h"
|
||||
#import "UIUtil.h"
|
||||
#import "TSSocketManager.h"
|
||||
#import "AboutTableViewController.h"
|
||||
#import "AdvancedSettingsTableViewController.h"
|
||||
#import "Environment.h"
|
||||
#import "NotificationSettingsViewController.h"
|
||||
#import "OWSContactsManager.h"
|
||||
#import "OWSLinkedDevicesTableViewController.h"
|
||||
#import "PrivacySettingsTableViewController.h"
|
||||
#import "PropertyListPreferences.h"
|
||||
#import "PushManager.h"
|
||||
#import "Signal-Swift.h"
|
||||
|
||||
#define kProfileCellHeight 87.0f
|
||||
#define kStandardCellHeight 44.0f
|
||||
|
||||
#define kNumberOfSections 4
|
||||
|
||||
#define kRegisteredNumberRow 0
|
||||
#define kInviteRow 0
|
||||
#define kPrivacyRow 1
|
||||
#define kNotificationRow 2
|
||||
#define kLinkedDevices 3 // we don't actually use this, instead we segue via Interface Builder
|
||||
#define kAdvancedRow 4
|
||||
#define kAboutRow 5
|
||||
|
||||
#define kNetworkRow 0
|
||||
#define kUnregisterRow 0
|
||||
|
||||
typedef enum {
|
||||
kRegisteredRows = 1,
|
||||
kNetworkStatusRows = 1,
|
||||
kGeneralRows = 6,
|
||||
kUnregisterRows = 1,
|
||||
} kRowsForSection;
|
||||
|
||||
typedef enum {
|
||||
kRegisteredNumberSection = 0,
|
||||
kNetworkStatusSection = 1,
|
||||
kGeneralSection = 2,
|
||||
kUnregisterSection = 3,
|
||||
} kSection;
|
||||
#import "TSAccountManager.h"
|
||||
#import "TSSocketManager.h"
|
||||
#import "UIUtil.h"
|
||||
|
||||
@interface SettingsTableViewController ()
|
||||
|
||||
|
@ -52,6 +23,8 @@ typedef enum {
|
|||
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@implementation SettingsTableViewController
|
||||
|
||||
- (instancetype)init
|
||||
|
@ -78,6 +51,12 @@ typedef enum {
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)loadView
|
||||
{
|
||||
self.tableViewStyle = UITableViewStylePlain;
|
||||
[super loadView];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
@ -85,146 +64,192 @@ typedef enum {
|
|||
|
||||
[self.navigationController.navigationBar setTranslucent:NO];
|
||||
|
||||
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
self.registeredNumber.text =
|
||||
[PhoneNumber bestEffortFormatPartialUserSpecifiedTextToLookLikeAPhoneNumber:[TSAccountManager localNumber]];
|
||||
self.registeredName.text = NSLocalizedString(@"REGISTERED_NUMBER_TEXT", @"");
|
||||
|
||||
[self initializeObserver];
|
||||
[TSSocketManager sendNotification];
|
||||
[self observeNotifications];
|
||||
|
||||
self.title = NSLocalizedString(@"SETTINGS_NAV_BAR_TITLE", @"Title for settings activity");
|
||||
self.networkStatusHeader.text = NSLocalizedString(@"NETWORK_STATUS_HEADER", @"");
|
||||
self.privacyLabel.text = NSLocalizedString(@"SETTINGS_PRIVACY_TITLE", @"");
|
||||
self.advancedLabel.text = NSLocalizedString(@"SETTINGS_ADVANCED_TITLE", @"");
|
||||
self.aboutLabel.text = NSLocalizedString(@"SETTINGS_ABOUT", @"");
|
||||
self.notificationsLabel.text = NSLocalizedString(@"SETTINGS_NOTIFICATIONS", nil);
|
||||
self.linkedDevicesLabel.text
|
||||
= NSLocalizedString(@"LINKED_DEVICES_TITLE", @"Menu item and navbar title for the device manager");
|
||||
self.inviteLabel.text = NSLocalizedString(@"SETTINGS_INVITE_TITLE", @"Settings table view cell label");
|
||||
|
||||
[self.destroyAccountButton setTitle:NSLocalizedString(@"SETTINGS_DELETE_ACCOUNT_BUTTON", @"")
|
||||
forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
// HACK to unselect rows when swiping back
|
||||
// http://stackoverflow.com/questions/19379510/uitableviewcell-doesnt-get-deselected-when-swiping-back-quickly
|
||||
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:animated];
|
||||
|
||||
[self updateTableContents];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:SocketOpenedNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:SocketClosedNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:SocketConnectingNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
#pragma mark - Table Contents
|
||||
|
||||
- (void)updateTableContents
|
||||
{
|
||||
OWSTableContents *contents = [OWSTableContents new];
|
||||
OWSTableSection *section = [OWSTableSection new];
|
||||
|
||||
__weak SettingsTableViewController *weakSelf = self;
|
||||
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
||||
UITableViewCell *cell = [UITableViewCell new];
|
||||
|
||||
UILabel *titleLabel = [UILabel new];
|
||||
titleLabel.font = [UIFont ows_mediumFontWithSize:20.f];
|
||||
titleLabel.textColor = [UIColor blackColor];
|
||||
titleLabel.text = NSLocalizedString(@"REGISTERED_NUMBER_TEXT", @"");
|
||||
titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
|
||||
UILabel *subtitleLabel = [UILabel new];
|
||||
subtitleLabel.font = [UIFont ows_mediumFontWithSize:15.f];
|
||||
subtitleLabel.textColor = [UIColor colorWithWhite:0.5f alpha:1.f];
|
||||
subtitleLabel.text =
|
||||
[PhoneNumber bestEffortFormatPartialUserSpecifiedTextToLookLikeAPhoneNumber:[TSAccountManager localNumber]];
|
||||
subtitleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
|
||||
UIView *stack = [UIView new];
|
||||
[cell addSubview:stack];
|
||||
[stack autoCenterInSuperview];
|
||||
|
||||
[stack addSubview:titleLabel];
|
||||
[stack addSubview:subtitleLabel];
|
||||
[titleLabel autoPinWidthToSuperview];
|
||||
[subtitleLabel autoPinWidthToSuperview];
|
||||
[titleLabel autoPinEdgeToSuperviewEdge:ALEdgeTop];
|
||||
[subtitleLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom];
|
||||
[subtitleLabel autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:titleLabel];
|
||||
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
return cell;
|
||||
}
|
||||
customRowHeight:96.f
|
||||
actionBlock:nil]];
|
||||
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
||||
UITableViewCell *cell = [UITableViewCell new];
|
||||
cell.textLabel.text = NSLocalizedString(
|
||||
@"NETWORK_STATUS_HEADER", @"");
|
||||
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
|
||||
cell.textLabel.textColor = [UIColor blackColor];
|
||||
|
||||
UILabel *accessoryLabel = [UILabel new];
|
||||
accessoryLabel.font = [UIFont ows_regularFontWithSize:18.f];
|
||||
switch ([TSSocketManager sharedManager].state) {
|
||||
case SocketManagerStateClosed:
|
||||
accessoryLabel.text = NSLocalizedString(@"NETWORK_STATUS_OFFLINE", @"");
|
||||
accessoryLabel.textColor = [UIColor ows_redColor];
|
||||
break;
|
||||
case SocketManagerStateConnecting:
|
||||
accessoryLabel.text = NSLocalizedString(@"NETWORK_STATUS_CONNECTING", @"");
|
||||
accessoryLabel.textColor = [UIColor ows_yellowColor];
|
||||
break;
|
||||
case SocketManagerStateOpen:
|
||||
accessoryLabel.text = NSLocalizedString(@"NETWORK_STATUS_CONNECTED", @"");
|
||||
accessoryLabel.textColor = [UIColor ows_greenColor];
|
||||
break;
|
||||
}
|
||||
[accessoryLabel sizeToFit];
|
||||
cell.accessoryView = accessoryLabel;
|
||||
return cell;
|
||||
}
|
||||
actionBlock:^{
|
||||
[OWSAlerts showAlertWithTitle:NSLocalizedString(@"NETWORK_STATUS_HEADER", @"")
|
||||
message:NSLocalizedString(@"NETWORK_STATUS_TEXT", @"")];
|
||||
}]];
|
||||
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_INVITE_TITLE",
|
||||
@"Settings table view cell label")
|
||||
actionBlock:^{
|
||||
[weakSelf showInviteFlow];
|
||||
}]];
|
||||
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_TITLE",
|
||||
@"Settings table view cell label")
|
||||
actionBlock:^{
|
||||
[weakSelf showPrivacy];
|
||||
}]];
|
||||
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_NOTIFICATIONS", nil)
|
||||
actionBlock:^{
|
||||
[weakSelf showNotifications];
|
||||
}]];
|
||||
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"LINKED_DEVICES_TITLE",
|
||||
@"Menu item and navbar title for the device manager")
|
||||
actionBlock:^{
|
||||
[weakSelf showLinkedDevices];
|
||||
}]];
|
||||
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_TITLE", @"")
|
||||
actionBlock:^{
|
||||
[weakSelf showAdvanced];
|
||||
}]];
|
||||
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_ABOUT", @"")
|
||||
actionBlock:^{
|
||||
[weakSelf showAbout];
|
||||
}]];
|
||||
|
||||
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{
|
||||
UITableViewCell *cell = [UITableViewCell new];
|
||||
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
button.backgroundColor = [UIColor ows_destructiveRedColor];
|
||||
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[button setTitle:NSLocalizedString(@"SETTINGS_DELETE_ACCOUNT_BUTTON", @"") forState:UIControlStateNormal];
|
||||
button.titleLabel.font = [UIFont ows_mediumFontWithSize:18.f];
|
||||
button.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[cell.contentView addSubview:button];
|
||||
[button autoSetDimension:ALDimensionHeight toSize:50.f];
|
||||
[button autoVCenterInSuperview];
|
||||
[button autoPinEdgeToSuperviewEdge:ALEdgeLeft
|
||||
withInset:cell.layoutMargins.left + cell.contentView.layoutMargins.left];
|
||||
[button autoPinEdgeToSuperviewEdge:ALEdgeRight
|
||||
withInset:cell.layoutMargins.right + cell.contentView.layoutMargins.right];
|
||||
[button addTarget:self action:@selector(unregisterUser) forControlEvents:UIControlEventTouchUpInside];
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
return cell;
|
||||
}
|
||||
customRowHeight:100.f
|
||||
actionBlock:nil]];
|
||||
|
||||
[contents addSection:section];
|
||||
|
||||
self.contents = contents;
|
||||
}
|
||||
|
||||
- (void)showInviteFlow
|
||||
{
|
||||
OWSInviteFlow *inviteFlow =
|
||||
[[OWSInviteFlow alloc] initWithPresentingViewController:self contactsManager:self.contactsManager];
|
||||
[self presentViewController:inviteFlow.actionSheetController animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)showPrivacy
|
||||
{
|
||||
PrivacySettingsTableViewController *vc = [[PrivacySettingsTableViewController alloc] init];
|
||||
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
|
||||
NSAssert(vc != nil, @"Privacy Settings View Controller must not be nil");
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
- (void)showNotifications
|
||||
{
|
||||
NotificationSettingsViewController *vc = [[NotificationSettingsViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
- (void)showLinkedDevices
|
||||
{
|
||||
OWSLinkedDevicesTableViewController *vc =
|
||||
[[UIStoryboard main] instantiateViewControllerWithIdentifier:@"OWSLinkedDevicesTableViewController"];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
- (void)showAdvanced
|
||||
{
|
||||
AdvancedSettingsTableViewController *vc = [[AdvancedSettingsTableViewController alloc] init];
|
||||
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
|
||||
NSAssert(vc != nil, @"Advanced Settings View Controller must not be nil");
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
- (void)showAbout
|
||||
{
|
||||
AboutTableViewController *vc = [[AboutTableViewController alloc] init];
|
||||
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
|
||||
NSAssert(vc != nil, @"About View Controller must not be nil");
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Table view data source
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return kNumberOfSections;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
switch (section) {
|
||||
case kRegisteredNumberSection:
|
||||
return kRegisteredRows;
|
||||
case kGeneralSection:
|
||||
return kGeneralRows;
|
||||
case kNetworkStatusSection:
|
||||
return kNetworkStatusRows;
|
||||
case kUnregisterSection:
|
||||
return kUnregisterRows;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
|
||||
switch (indexPath.section) {
|
||||
case kGeneralSection: {
|
||||
switch (indexPath.row) {
|
||||
case kInviteRow: {
|
||||
OWSInviteFlow *inviteFlow =
|
||||
[[OWSInviteFlow alloc] initWithPresentingViewController:self
|
||||
contactsManager:self.contactsManager];
|
||||
[self presentViewController:inviteFlow.actionSheetController
|
||||
animated:YES
|
||||
completion:^{
|
||||
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
}];
|
||||
break;
|
||||
}
|
||||
case kPrivacyRow: {
|
||||
PrivacySettingsTableViewController *vc = [[PrivacySettingsTableViewController alloc] init];
|
||||
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
|
||||
NSAssert(vc != nil, @"Privacy Settings View Controller must not be nil");
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
break;
|
||||
}
|
||||
case kNotificationRow: {
|
||||
NotificationSettingsViewController *vc = [[NotificationSettingsViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
break;
|
||||
}
|
||||
case kAdvancedRow: {
|
||||
AdvancedSettingsTableViewController *vc = [[AdvancedSettingsTableViewController alloc] init];
|
||||
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
|
||||
NSAssert(vc != nil, @"Advanced Settings View Controller must not be nil");
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
break;
|
||||
}
|
||||
case kAboutRow: {
|
||||
AboutTableViewController *vc = [[AboutTableViewController alloc] init];
|
||||
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
|
||||
NSAssert(vc != nil, @"About View Controller must not be nil");
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
DDLogError(@"%@ Unhandled row selected at index path: %@", self.tag, indexPath);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case kNetworkStatusSection: {
|
||||
break;
|
||||
}
|
||||
|
||||
case kUnregisterSection: {
|
||||
[self unregisterUser:nil];
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
switch (indexPath.section) {
|
||||
case kNetworkStatusSection: {
|
||||
return NO;
|
||||
}
|
||||
|
||||
case kUnregisterSection: {
|
||||
return NO;
|
||||
}
|
||||
|
||||
default:
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)unregisterUser:(id)sender {
|
||||
- (void)unregisterUser
|
||||
{
|
||||
UIAlertController *alertController =
|
||||
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"CONFIRM_ACCOUNT_DESTRUCTION_TITLE", @"")
|
||||
message:NSLocalizedString(@"CONFIRM_ACCOUNT_DESTRUCTION_TEXT", @"")
|
||||
|
@ -250,43 +275,20 @@ typedef enum {
|
|||
}];
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
|
||||
if (indexPath.section == kNetworkStatusSection) {
|
||||
[OWSAlerts showAlertWithTitle:NSLocalizedString(@"NETWORK_STATUS_HEADER", @"")
|
||||
message:NSLocalizedString(@"NETWORK_STATUS_TEXT", @"")];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Socket Status Notifications
|
||||
|
||||
- (void)initializeObserver {
|
||||
- (void)observeNotifications
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(socketDidOpen)
|
||||
name:SocketOpenedNotification
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(socketDidClose)
|
||||
name:SocketClosedNotification
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(socketIsConnecting)
|
||||
name:SocketConnectingNotification
|
||||
selector:@selector(socketStateDidChange)
|
||||
name:kNSNotification_SocketManagerStateDidChange
|
||||
object:nil];
|
||||
}
|
||||
|
||||
- (void)socketDidOpen {
|
||||
self.networkStatusLabel.text = NSLocalizedString(@"NETWORK_STATUS_CONNECTED", @"");
|
||||
self.networkStatusLabel.textColor = [UIColor ows_greenColor];
|
||||
}
|
||||
|
||||
- (void)socketDidClose {
|
||||
self.networkStatusLabel.text = NSLocalizedString(@"NETWORK_STATUS_OFFLINE", @"");
|
||||
self.networkStatusLabel.textColor = [UIColor ows_redColor];
|
||||
}
|
||||
|
||||
- (void)socketIsConnecting {
|
||||
self.networkStatusLabel.text = NSLocalizedString(@"NETWORK_STATUS_CONNECTING", @"");
|
||||
self.networkStatusLabel.textColor = [UIColor ows_yellowColor];
|
||||
- (void)socketStateDidChange {
|
||||
OWSAssert([NSThread isMainThread]);
|
||||
|
||||
[self updateTableContents];
|
||||
}
|
||||
|
||||
#pragma mark - Logging
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
//
|
||||
// SignalsNavigationController.m
|
||||
// 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 "SignalsNavigationController.h"
|
||||
|
@ -22,7 +18,7 @@ static double const STALLED_PROGRESS = 0.9;
|
|||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
[self initializeObserver];
|
||||
[TSSocketManager sendNotification];
|
||||
[self updateSocketStatusView];
|
||||
}
|
||||
|
||||
- (void)initializeSocketStatusBar {
|
||||
|
@ -48,57 +44,52 @@ static double const STALLED_PROGRESS = 0.9;
|
|||
|
||||
- (void)initializeObserver {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(socketDidOpen)
|
||||
name:SocketOpenedNotification
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(socketDidClose)
|
||||
name:SocketClosedNotification
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(socketIsConnecting)
|
||||
name:SocketConnectingNotification
|
||||
selector:@selector(socketManagerStateDidChange)
|
||||
name:kNSNotification_SocketManagerStateDidChange
|
||||
object:nil];
|
||||
}
|
||||
|
||||
- (void)socketDidOpen {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[_updateStatusTimer invalidate];
|
||||
for (UIView *view in self.navigationBar.subviews) {
|
||||
if ([view isKindOfClass:[UIProgressView class]]) {
|
||||
[view removeFromSuperview];
|
||||
_socketStatusView = nil;
|
||||
- (void)socketManagerStateDidChange {
|
||||
OWSAssert([NSThread isMainThread]);
|
||||
|
||||
[self updateSocketStatusView];
|
||||
}
|
||||
|
||||
- (void)updateSocketStatusView {
|
||||
OWSAssert([NSThread isMainThread]);
|
||||
|
||||
switch ([TSSocketManager sharedManager].state) {
|
||||
case SocketManagerStateClosed:
|
||||
if (_socketStatusView == nil) {
|
||||
[self initializeSocketStatusBar];
|
||||
_updateStatusTimer = [NSTimer scheduledTimerWithTimeInterval:0.5
|
||||
target:self
|
||||
selector:@selector(updateProgress)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
|
||||
} else if (_socketStatusView.progress >= STALLED_PROGRESS) {
|
||||
[_updateStatusTimer invalidate];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (void)socketDidClose {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (_socketStatusView == nil) {
|
||||
[self initializeSocketStatusBar];
|
||||
_updateStatusTimer = [NSTimer scheduledTimerWithTimeInterval:0.5
|
||||
target:self
|
||||
selector:@selector(updateSocketConnecting)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
|
||||
} else if (_socketStatusView.progress >= STALLED_PROGRESS) {
|
||||
break;
|
||||
case SocketManagerStateConnecting:
|
||||
// Do nothing.
|
||||
break;
|
||||
case SocketManagerStateOpen:
|
||||
[_updateStatusTimer invalidate];
|
||||
}
|
||||
});
|
||||
for (UIView *view in self.navigationBar.subviews) {
|
||||
if ([view isKindOfClass:[UIProgressView class]]) {
|
||||
[view removeFromSuperview];
|
||||
_socketStatusView = nil;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateSocketConnecting {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
double progress = _socketStatusView.progress + 0.05;
|
||||
_socketStatusView.progress = (float)MIN(progress, STALLED_PROGRESS);
|
||||
});
|
||||
- (void)updateProgress {
|
||||
double progress = _socketStatusView.progress + 0.05;
|
||||
_socketStatusView.progress = (float) MIN(progress, STALLED_PROGRESS);
|
||||
}
|
||||
|
||||
- (void)socketIsConnecting {
|
||||
// Nothing to see here currently
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
_callUIAdapter = callUIAdapter;
|
||||
_messageSender = messageSender;
|
||||
|
||||
OWSSignalService *signalService = [OWSSignalService new];
|
||||
OWSSignalService *signalService = [OWSSignalService sharedInstance];
|
||||
_messageFetcherJob = [[OWSMessageFetcherJob alloc] initWithMessagesManager:messagesManager
|
||||
networkManager:networkManager
|
||||
signalService:signalService];
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
/* Title for the 'add group member' view. */
|
||||
"ADD_GROUP_MEMBER_VIEW_TITLE" = "Add Member";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
/* Message shown in conversation view that offers to add an unknown user to your phone's contacts. */
|
||||
"ADD_TO_CONTACTS_OFFER" = "Would you like to add this user to your contacts?";
|
||||
|
||||
/* The label for the 'discard' button in alerts and action sheets. */
|
||||
|
@ -217,6 +217,9 @@
|
|||
/* The generic name used for calls if CallKit privacy is enabled */
|
||||
"CALLKIT_ANONYMOUS_CONTACT_NAME" = "Signal User";
|
||||
|
||||
/* Title for the 'censorship circumvention country' view. */
|
||||
"CENSORSHIP_CIRCUMVENTION_COUNTRY_VIEW_TITLE" = "Select Country";
|
||||
|
||||
/* Activity Sheet label */
|
||||
"COMPARE_SAFETY_NUMBER_ACTION" = "Compare with Clipboard";
|
||||
|
||||
|
@ -331,6 +334,9 @@
|
|||
/* Generic short text for button to dismiss a dialog */
|
||||
"DISMISS_BUTTON_TEXT" = "Dismiss";
|
||||
|
||||
/* Section title for the 'domain fronting country' view. */
|
||||
"DOMAIN_FRONTING_COUNTRY_VIEW_SECTION_HEADER" = "Censorship Circumvention Location";
|
||||
|
||||
/* Alert body for when the user has just tried to edit a contacts after declining to give Signal contacts permissions */
|
||||
"EDIT_CONTACT_WITHOUT_CONTACTS_PERMISSION_ALERT_BODY" = "You can give access in the Settings app.";
|
||||
|
||||
|
@ -460,9 +466,12 @@
|
|||
/* No comment provided by engineer. */
|
||||
"ERROR_MESSAGE_NO_SESSION" = "No available session for contact.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
/* Shown when signal users safety numbers changed */
|
||||
"ERROR_MESSAGE_NON_BLOCKING_IDENTITY_CHANGE" = "Safety number changed.";
|
||||
|
||||
/* Shown when signal users safety numbers changed, embeds the user's {{name or phone number}} */
|
||||
"ERROR_MESSAGE_NON_BLOCKING_IDENTITY_CHANGE_FORMAT" = "ERROR_MESSAGE_NON_BLOCKING_IDENTITY_CHANGE_FORMAT";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"ERROR_MESSAGE_UNKNOWN_ERROR" = "An unknown error occurred.";
|
||||
|
||||
|
@ -1087,6 +1096,27 @@
|
|||
/* Title for the 'add to block list' view. */
|
||||
"SETTINGS_ADD_TO_BLOCK_LIST_TITLE" = "Block";
|
||||
|
||||
/* Label for the 'manual censorship circumvention' switch. */
|
||||
"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION" = "Censorship Circumvention";
|
||||
|
||||
/* Label for the 'manual censorship circumvention' country. Embeds {{the manual censorship circumvention country}}. */
|
||||
"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_COUNTRY_FORMAT" = "Location: %@";
|
||||
|
||||
/* Table footer for the 'censorship circumvention' section when censorship circumvention can be manually enabled. */
|
||||
"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_FOOTER" = "If enabled, Signal will attempt to circumvent censorship. Do not enable this feature unless you are in a location where Signal is censored.";
|
||||
|
||||
/* Table footer for the 'censorship circumvention' section shown when censorship circumvention has been auto-enabled based on local phone number. */
|
||||
"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_FOOTER_AUTO_ENABLED" = "Censorship circumvention has been activated based on your account's phone number.";
|
||||
|
||||
/* Table footer for the 'censorship circumvention' section shown when the app is not connected to the internet. */
|
||||
"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_FOOTER_NO_CONNECTION" = "Censorship circumvention can only be activated when connected to the internet.";
|
||||
|
||||
/* Table footer for the 'censorship circumvention' section shown when the app is connected to the Signal service. */
|
||||
"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_FOOTER_WEBSOCKET_CONNECTED" = "Censorship circumvention is not necessary; you are already connected to the Signal service.";
|
||||
|
||||
/* Table header for the 'censorship circumvention' section. */
|
||||
"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_HEADER" = "Censorship Circumvention";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"SETTINGS_ADVANCED_DEBUGLOG" = "Enable Debug Log";
|
||||
|
||||
|
@ -1165,7 +1195,7 @@
|
|||
/* Short table cell label */
|
||||
"SETTINGS_PRIVACY_CALLKIT_TITLE" = "iOS Call Integration";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
/* Settings table view cell label */
|
||||
"SETTINGS_PRIVACY_TITLE" = "Privacy";
|
||||
|
||||
/* Section header */
|
||||
|
@ -1237,7 +1267,7 @@
|
|||
/* In Inbox view, last message label for thread with corrupted attachment. */
|
||||
"UNKNOWN_ATTACHMENT_LABEL" = "Unknown attachment";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
/* Message shown in conversation view that offers to block an unknown user. */
|
||||
"UNKNOWN_CONTACT_BLOCK_OFFER" = "User not in your contacts. Would you like to block this user?";
|
||||
|
||||
/* Displayed if for some reason we can't determine a contacts phone number *or* name */
|
||||
|
|
Loading…
Reference in a new issue