Skip to content

Commit d7f15cb

Browse files
authored
Merge pull request #495 from jorgeblacio/fixed_domain_fixes
Fixed some issues with enterprise domains. Also other minor fixes.
2 parents 016fb84 + 20b02c1 commit d7f15cb

File tree

12 files changed

+31
-23
lines changed

12 files changed

+31
-23
lines changed

NotificationExtension/NotificationService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class NotificationService: UNNotificationServiceExtension {
7272
let contentHandler = contentHandler,
7373
let bestAttemptContent = bestAttemptContent {
7474
bestAttemptContent.categoryIdentifier = "GENERIC_PUSH"
75-
bestAttemptContent.title = "\(activeAccount)\(Env.domain)"
75+
bestAttemptContent.title = Utils.validateEmail(activeAccount) ? activeAccount : "\(activeAccount)\(Env.domain)"
7676
bestAttemptContent.body = String.localize("You may have new emails")
7777
bestAttemptContent.badge = NSNumber(value: SharedDB.getUnreadCounters() + 1)
7878
contentHandler(bestAttemptContent)

iOS-Email-Client.xcodeproj/project.pbxproj

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/* Begin PBXBuildFile section */
1010
347A659922E126F1002D9151 /* LinkFileHeaderData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347A659822E126F1002D9151 /* LinkFileHeaderData.swift */; };
11+
34857664235918BC002E2049 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C5FD825205C857C000E5F14 /* Utils.swift */; };
1112
3498992A22EA17C900FB00DC /* RemoveDevicesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3498992922EA17C900FB00DC /* RemoveDevicesViewController.swift */; };
1213
34C4173622BC20530095DF23 /* FirebaseCoreDiagnostics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34C4172F22BC20520095DF23 /* FirebaseCoreDiagnostics.framework */; };
1314
34C4173722BC20530095DF23 /* FirebaseInstanceID.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34C4173022BC20520095DF23 /* FirebaseInstanceID.framework */; };
@@ -2307,6 +2308,7 @@
23072308
A7CC38832193A1C600C8355A /* CriptextError.swift in Sources */,
23082309
A7CC388221939FAD00C8355A /* ResponseData.swift in Sources */,
23092310
A7CC38842193A1DE00C8355A /* Env.swift in Sources */,
2311+
34857664235918BC002E2049 /* Utils.swift in Sources */,
23102312
A7CC386221934EE400C8355A /* CriptextIdentityKeyStore.swift in Sources */,
23112313
A7CC384F219247B800C8355A /* EmailContact.swift in Sources */,
23122314
9539F99421FBC71F00A4C813 /* FileUtils.swift in Sources */,
@@ -2786,7 +2788,7 @@
27862788
INFOPLIST_FILE = "iOS-Email-Client/Info.plist";
27872789
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
27882790
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
2789-
MARKETING_VERSION = 1.1.23;
2791+
MARKETING_VERSION = 1.1.24;
27902792
OTHER_LDFLAGS = (
27912793
"-ObjC",
27922794
"$(inherited)",
@@ -2827,7 +2829,7 @@
28272829
INFOPLIST_FILE = "iOS-Email-Client/Info.plist";
28282830
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
28292831
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
2830-
MARKETING_VERSION = 1.1.23;
2832+
MARKETING_VERSION = 1.1.24;
28312833
OTHER_LDFLAGS = (
28322834
"-ObjC",
28332835
"$(inherited)",
@@ -2974,7 +2976,7 @@
29742976
INFOPLIST_FILE = "iOS-Email-Client/Info.plist";
29752977
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
29762978
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
2977-
MARKETING_VERSION = 1.1.23;
2979+
MARKETING_VERSION = 1.1.24;
29782980
OTHER_LDFLAGS = (
29792981
"-ObjC",
29802982
"$(inherited)",
@@ -3034,7 +3036,7 @@
30343036
INFOPLIST_FILE = ShareExtension/Info.plist;
30353037
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
30363038
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
3037-
MARKETING_VERSION = 1.1.23;
3039+
MARKETING_VERSION = 1.1.24;
30383040
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
30393041
MTL_FAST_MATH = YES;
30403042
PRODUCT_BUNDLE_IDENTIFIER = com.criptext.mail.ShareExtension;
@@ -3064,7 +3066,7 @@
30643066
INFOPLIST_FILE = ShareExtension/Info.plist;
30653067
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
30663068
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
3067-
MARKETING_VERSION = 1.1.23;
3069+
MARKETING_VERSION = 1.1.24;
30683070
MTL_FAST_MATH = YES;
30693071
PRODUCT_BUNDLE_IDENTIFIER = com.criptext.mail.ShareExtension;
30703072
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -3094,7 +3096,7 @@
30943096
INFOPLIST_FILE = ShareExtension/Info.plist;
30953097
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
30963098
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
3097-
MARKETING_VERSION = 1.1.23;
3099+
MARKETING_VERSION = 1.1.24;
30983100
MTL_FAST_MATH = YES;
30993101
PRODUCT_BUNDLE_IDENTIFIER = com.criptext.mail.support.ShareExtension;
31003102
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -3125,7 +3127,7 @@
31253127
INFOPLIST_FILE = NotificationExtension/Info.plist;
31263128
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
31273129
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
3128-
MARKETING_VERSION = 1.1.23;
3130+
MARKETING_VERSION = 1.1.24;
31293131
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
31303132
MTL_FAST_MATH = YES;
31313133
PRODUCT_BUNDLE_IDENTIFIER = com.criptext.mail.NotificationExtension;
@@ -3158,7 +3160,7 @@
31583160
INFOPLIST_FILE = NotificationExtension/Info.plist;
31593161
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
31603162
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
3161-
MARKETING_VERSION = 1.1.23;
3163+
MARKETING_VERSION = 1.1.24;
31623164
MTL_FAST_MATH = YES;
31633165
PRODUCT_BUNDLE_IDENTIFIER = com.criptext.mail.NotificationExtension;
31643166
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -3191,7 +3193,7 @@
31913193
INFOPLIST_FILE = NotificationExtension/Info.plist;
31923194
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
31933195
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
3194-
MARKETING_VERSION = 1.1.23;
3196+
MARKETING_VERSION = 1.1.24;
31953197
MTL_FAST_MATH = YES;
31963198
PRODUCT_BUNDLE_IDENTIFIER = com.criptext.mail.support.NotificationExtension;
31973199
PRODUCT_NAME = "$(TARGET_NAME)";

iOS-Email-Client/Constants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct Constants {
1616
static let basePopoverHeight = 102
1717
static let labelPopoverHeight = 48
1818

19-
static let footer = "<br/><br/><br/><span>Sent with <a style=\"color:#0091ff;text-decoration: none;\" href=\"https://goo.gl/qW4Aks\">Criptext</a> secure email</span>"
19+
static let footer = "<br/><br/><br/><span><i>Sent with Criptext secure email</i></span>"
2020

2121
static let unsendEmail = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" +
2222
"<html xmlns=\"http://www.w3.org/1999/xhtml\">" +

iOS-Email-Client/Controllers/ComposeViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ class ComposeViewController: UIViewController {
393393
draft.threadId = composerData.threadId ?? "\(draft.key)"
394394
draft.labels.append(DBManager.getLabel(SystemLabel.draft.id)!)
395395
draft.files.append(objectsIn: fileManager.registeredFiles)
396-
draft.fromAddress = "\(activeAccount.name) <\(activeAccount.username)\(Constants.domain)>"
396+
draft.fromAddress = "\(activeAccount.name) <\(activeAccount.email)>"
397397
draft.buildCompoundKey()
398398
DBManager.store(draft)
399399

@@ -410,7 +410,7 @@ class ComposeViewController: UIViewController {
410410
self.bccField.allTokens.forEach { (token) in
411411
self.fillEmailContacts(emailContacts: &emailContacts, token: token, emailDetail: draft, type: ContactType.bcc)
412412
}
413-
self.fillEmailContacts(emailContacts: &emailContacts, token: CLToken(displayText: "\(activeAccount.username)\(Constants.domain)", context: nil), emailDetail: draft, type: ContactType.from)
413+
self.fillEmailContacts(emailContacts: &emailContacts, token: CLToken(displayText: activeAccount.email, context: nil), emailDetail: draft, type: ContactType.from)
414414

415415
DBManager.store(emailContacts)
416416

@@ -435,7 +435,7 @@ class ComposeViewController: UIViewController {
435435
emailContact.compoundKey = "\(emailDetail.key):\(email):\(type.rawValue)"
436436
if let contact = DBManager.getContact(email) {
437437
emailContact.contact = contact
438-
if(contact.email != "\(activeAccount.username)\(Env.domain)"){
438+
if(contact.email != activeAccount.email){
439439
DBManager.updateScore(contact: contact)
440440
}
441441
} else {

iOS-Email-Client/Controllers/InboxViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ extension InboxViewController: InboxTableViewCellDelegate, UITableViewDelegate {
12281228
emailDetailData.selectedLabel = selectedLabel
12291229
emailDetailData.labels = Array(labelsSet)
12301230
emailDetailData.subject = subject
1231-
emailDetailData.accountEmail = "\(myAccount.username)\(Constants.domain)"
1231+
emailDetailData.accountEmail = self.myAccount.email
12321232
var emailState = Email.State()
12331233
emailState.isExpanded = true
12341234
emailDetailData.emailStates[lastEmailKey] = emailState

iOS-Email-Client/Controllers/Login/ConnectDeviceViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class ConnectDeviceViewController: UIViewController{
215215
DBManager.update(account: myAccount, jwt: signupData.token, refreshToken: refreshToken, regId: regId, identityB64: identityB64)
216216
let myContact = Contact()
217217
myContact.displayName = myAccount.name
218-
myContact.email = "\(myAccount.username)\(Constants.domain)"
218+
myContact.email = myAccount.email
219219
DBManager.store([myContact], account: myAccount)
220220
DBManager.createSystemLabels()
221221
let defaults = CriptextDefaults()

iOS-Email-Client/Controllers/ManualSyncViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ManualSyncViewController: UIViewController{
4444
WebSocketManager.sharedInstance.delegate = nil
4545
socket = SingleWebSocket()
4646
socket?.delegate = self
47-
connectUIView.initialLoad(email: "\(myAccount.username)\(Constants.domain)")
47+
connectUIView.initialLoad(email: myAccount.email)
4848
self.applyTheme()
4949
scheduleWorker.delegate = self
5050
connectUIView.goBack = {

iOS-Email-Client/Controllers/RecoveryEmailViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class RecoveryEmailViewController: UIViewController {
136136
guard let email = emailTextField.text else {
137137
return
138138
}
139-
guard email != "\(myAccount.username)\(Constants.domain)" else {
139+
guard email != myAccount.email else {
140140
emailTextField.detail = String.localize("SAME_ACCOUNT")
141141
return
142142
}

iOS-Email-Client/Libs/EventHandler.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ class EventHandler {
199199
return
200200
}
201201
let actionType: FeedItem.Action = event.fileId == nil ? .open : .download
202-
guard !DBManager.feedExists(emailId: event.emailId, type: actionType.rawValue, contactId: "\(event.from)\(Constants.domain)"),
203-
let contact = DBManager.getContact("\(event.from)\(Constants.domain)"),
202+
guard !DBManager.feedExists(emailId: event.emailId, type: actionType.rawValue, contactId: event.from),
203+
let contact = DBManager.getContact(event.from),
204204
let email = DBManager.getMail(key: event.emailId, account: myAccount) else {
205205
finishCallback(true, .Empty)
206206
return

iOS-Email-Client/Model/EventData.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,14 @@ class EventData {
9595
let type: Int
9696

9797
init(params: [String: Any]){
98+
var recipientId = params["from"] as! String
99+
var domain = Constants.domain
100+
if let fromObject = params["fromDomain"] as? [String: Any] {
101+
recipientId = fromObject["recipientId"] as! String
102+
domain = fromObject["domain"] as! String
103+
}
98104
emailId = params["metadataKey"] as! Int
99-
from = params["from"] as! String
105+
from = "\(recipientId)@\(domain)"
100106
fileId = params["file"] as? String
101107
type = params["type"] as! Int
102108

0 commit comments

Comments
 (0)