Skip to content

Commit b3b5453

Browse files
Remove outdated server list for new signups
1 parent 1faaed2 commit b3b5453

File tree

7 files changed

+44
-78
lines changed

7 files changed

+44
-78
lines changed

ChatSecureCore/Classes/View Controllers/Login View Controllers/OTRBaseLoginViewController.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,10 @@ - (void) updateUsernameRow {
189189
if (!usernameRow) {
190190
return;
191191
}
192-
XLFormRowDescriptor *serverRow = [self.form formRowWithTag:kOTRXLFormXMPPServerTag];
192+
XLFormRowDescriptor *serverRow = [self.form formRowWithTag:kOTRXLFormXMPPServerDomainTag];
193193
NSString *domain = nil;
194194
if (serverRow) {
195-
OTRXMPPServerInfo *serverInfo = serverRow.value;
196-
domain = serverInfo.domain;
195+
domain = serverRow.value;
197196
usernameRow.value = domain;
198197
} else {
199198
usernameRow.value = self.account.username;
@@ -238,7 +237,7 @@ - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexP
238237
-(void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)formRow oldValue:(id)oldValue newValue:(id)newValue
239238
{
240239
[super formRowDescriptorValueHasChanged:formRow oldValue:oldValue newValue:newValue];
241-
if (formRow.tag == kOTRXLFormXMPPServerTag) {
240+
if (formRow.tag == kOTRXLFormXMPPServerDomainTag) {
242241
[self updateUsernameRow];
243242
}
244243
}

ChatSecureCore/Classes/View Controllers/Login View Controllers/OTRXLFormCreator.m

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
NSString *const kOTRXLFormHostnameTextFieldTag = @"kOTRXLFormHostnameTextFieldTag";
2828
NSString *const kOTRXLFormPortTextFieldTag = @"kOTRXLFormPortTextFieldTag";
2929
NSString *const kOTRXLFormResourceTextFieldTag = @"kOTRXLFormResourceTextFieldTag";
30-
NSString *const kOTRXLFormXMPPServerTag = @"kOTRXLFormXMPPServerTag";
30+
NSString *const kOTRXLFormXMPPServerDomainTag = @"kOTRXLFormXMPPServerDomainTag";
3131

3232
NSString *const kOTRXLFormShowAdvancedTag = @"kOTRXLFormShowAdvancedTag";
3333

@@ -124,7 +124,7 @@ + (XLFormDescriptor *)formForAccountType:(OTRAccountType)accountType createAccou
124124
}
125125

126126
serverSection.footerTitle = Server_String_Hint();
127-
[serverSection addFormRow:[self serverRowDescriptorWithValue:nil]];
127+
[serverSection addFormRow:[self serverRowDescriptor]];
128128

129129
XLFormSectionDescriptor *torSection = [XLFormSectionDescriptor formSectionWithTitle:@"Tor"];
130130
torSection.footerTitle = TOR_WARNING_MESSAGE_STRING();
@@ -285,16 +285,13 @@ + (XLFormRowDescriptor *)resourceRowDescriptorWithValue:(NSString *)value
285285
return resourceRowDescriptor;
286286
}
287287

288-
+ (XLFormRowDescriptor *)serverRowDescriptorWithValue:(OTRXMPPServerInfo *)value
288+
+ (XLFormRowDescriptor *)serverRowDescriptor
289289
{
290-
XLFormRowDescriptor *xmppServerDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormXMPPServerTag rowType:kOTRFormRowDescriptorTypeXMPPServer];
291-
if (!value) {
292-
value = [[OTRXMPPServerInfo defaultServerList] firstObject];
293-
}
294-
xmppServerDescriptor.value = value;
295-
xmppServerDescriptor.action.viewControllerClass = [OTRXMPPServerListViewController class];
290+
XLFormRowDescriptor *serverRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormXMPPServerDomainTag rowType:XLFormRowDescriptorTypeURL title:CUSTOM_STRING()];
291+
serverRowDescriptor.required = YES;
292+
[serverRowDescriptor.cellConfigAtConfigure setObject:@"example.com" forKey:@"textField.placeholder"];
296293

297-
return xmppServerDescriptor;
294+
return serverRowDescriptor;
298295
}
299296

300297

ChatSecureCore/Classes/View Controllers/Login View Controllers/OTRXMPPCreateAccountHandler.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ @implementation OTRXMPPCreateAccountHandler
2626
- (OTRXMPPAccount *)moveValues:(XLFormDescriptor *)form intoAccount:(OTRXMPPAccount *)account
2727
{
2828
account = (OTRXMPPAccount *)[super moveValues:form intoAccount:account];
29-
OTRXMPPServerInfo *serverInfo = [[form formRowWithTag:kOTRXLFormXMPPServerTag] value];
29+
NSString *serverDomain = [[form formRowWithTag:kOTRXLFormXMPPServerDomainTag] value];
3030

3131
NSString *username = nil;
3232
if ([account.username containsString:@"@"]) {
@@ -35,11 +35,9 @@ - (OTRXMPPAccount *)moveValues:(XLFormDescriptor *)form intoAccount:(OTRXMPPAcco
3535
} else {
3636
username = account.username;
3737
}
38-
39-
NSString *domain = serverInfo.domain;
40-
38+
4139
//Create valid 'username' which is a bare jid ([email protected])
42-
XMPPJID *jid = [XMPPJID jidWithUser:username domain:domain resource:nil];
40+
XMPPJID *jid = [XMPPJID jidWithUser:username domain:serverDomain resource:nil];
4341

4442
if (jid) {
4543
account.username = [jid bare];

ChatSecureCore/Classes/View Controllers/Login View Controllers/OTRXMPPLoginHandler.m

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,9 @@ - (OTRXMPPAccount *)moveValues:(XLFormDescriptor *)form intoAccount:(OTRXMPPAcco
125125
NSString *resource = [[form formRowWithTag:kOTRXLFormResourceTextFieldTag] value];
126126

127127
if (![hostname length]) {
128-
XLFormRowDescriptor *serverRow = [form formRowWithTag:kOTRXLFormXMPPServerTag];
128+
XLFormRowDescriptor *serverRow = [form formRowWithTag:kOTRXLFormXMPPServerDomainTag];
129129
if (serverRow) {
130-
OTRXMPPServerInfo *serverInfo = serverRow.value;
131-
hostname = serverInfo.domain;
130+
hostname = serverRow.value;
132131
}
133132
}
134133
account.domain = hostname;
@@ -161,18 +160,6 @@ - (OTRXMPPAccount *)moveValues:(XLFormDescriptor *)form intoAccount:(OTRXMPPAcco
161160
account.resource = jid.resource;
162161
account.displayName = nickname;
163162

164-
// Use server's .onion if possible, else use FQDN
165-
if (account.accountType == OTRAccountTypeXMPPTor) {
166-
OTRXMPPServerInfo *serverInfo = [[form formRowWithTag:kOTRXLFormXMPPServerTag] value];
167-
OTRXMPPTorAccount *torAccount = (OTRXMPPTorAccount*)account;
168-
torAccount.onion = serverInfo.onion;
169-
if (torAccount.onion.length) {
170-
torAccount.domain = torAccount.onion;
171-
} else if (serverInfo.server.length) {
172-
torAccount.domain = serverInfo.server;
173-
}
174-
}
175-
176163
// Start generating our OTR key here so it's ready when we need it
177164

178165
[OTRProtocolManager.encryptionManager.otrKit generatePrivateKeyForAccountName:account.username protocol:kOTRProtocolTypeXMPP completion:^(OTRFingerprint *fingerprint, NSError *error) {

ChatSecureCore/Public/OTRXLFormCreator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extern NSString *const kOTRXLFormLoginAutomaticallySwitchTag;
2020
extern NSString *const kOTRXLFormHostnameTextFieldTag;
2121
extern NSString *const kOTRXLFormPortTextFieldTag;
2222
extern NSString *const kOTRXLFormResourceTextFieldTag;
23-
extern NSString *const kOTRXLFormXMPPServerTag;
23+
extern NSString *const kOTRXLFormXMPPServerDomainTag;
2424
extern NSString *const kOTRXLFormUseTorTag;
2525
extern NSString *const kOTRXLFormAutomaticURLFetchTag;
2626

OTRResources/Interface/Onboarding.storyboard

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="u63-jC-sYl">
3-
<device id="retina4_7" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="u63-jC-sYl">
3+
<device id="retina4_7" orientation="portrait" appearance="light"/>
64
<dependencies>
75
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
9-
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
107
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
118
</dependencies>
129
<scenes>
@@ -73,7 +70,7 @@
7370
</connections>
7471
</button>
7572
</subviews>
76-
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
73+
<color key="backgroundColor" systemColor="secondarySystemBackgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
7774
<constraints>
7875
<constraint firstItem="3ZM-WP-oof" firstAttribute="top" secondItem="KXC-AD-yXL" secondAttribute="bottom" constant="20" id="2qT-0B-MgI"/>
7976
<constraint firstAttribute="centerX" secondItem="VS9-AF-nlm" secondAttribute="centerX" id="6zQ-bP-fnL"/>
@@ -181,11 +178,12 @@
181178
<constraint firstAttribute="width" constant="283" id="K1M-Mc-jMV"/>
182179
</constraints>
183180
<string key="text">ChatSecure can now automatically notify compatible offline contacts that you'd like to establish a secure conversation. To protect your privacy, these notifications currently do not contain any content.</string>
181+
<color key="textColor" systemColor="labelColor" cocoaTouchSystemColor="darkTextColor"/>
184182
<fontDescription key="fontDescription" type="system" pointSize="16"/>
185183
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
186184
</textView>
187185
</subviews>
188-
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
186+
<color key="backgroundColor" systemColor="secondarySystemBackgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
189187
<constraints>
190188
<constraint firstItem="02O-Hn-a8E" firstAttribute="top" secondItem="i8G-bh-AN7" secondAttribute="bottom" constant="20" id="3Oa-L9-k3n"/>
191189
<constraint firstItem="02O-Hn-a8E" firstAttribute="top" secondItem="JPq-4W-Efa" secondAttribute="bottom" id="8f1-YP-KSP"/>
@@ -218,11 +216,11 @@
218216
<point key="canvasLocation" x="249" y="1251"/>
219217
</scene>
220218
</scenes>
221-
<resources>
222-
<image name="PushOnboarding" width="293" height="293"/>
223-
<image name="chatsecure_logo_transparent" width="132" height="175"/>
224-
</resources>
225219
<inferredMetricsTieBreakers>
226220
<segue reference="fSh-dA-tdB"/>
227221
</inferredMetricsTieBreakers>
222+
<resources>
223+
<image name="PushOnboarding" width="293.5" height="293.5"/>
224+
<image name="chatsecure_logo_transparent" width="132" height="175"/>
225+
</resources>
228226
</document>

0 commit comments

Comments
 (0)