Skip to content

Commit 1f2e0cd

Browse files
authored
Merge pull request #477 from jorgeblacio/release_1_1_19
Landscape mode in iPad, also sending device info on contact support links.
2 parents fb5d1f8 + e1c3bde commit 1f2e0cd

File tree

8 files changed

+41
-5
lines changed

8 files changed

+41
-5
lines changed

NotificationExtension/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>XPC!</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.1.18</string>
20+
<string>1.1.19</string>
2121
<key>CFBundleVersion</key>
2222
<string>1</string>
2323
<key>NSExtension</key>

ShareExtension/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>XPC!</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.1.18</string>
20+
<string>1.1.19</string>
2121
<key>CFBundleVersion</key>
2222
<string>1</string>
2323
<key>NSExtension</key>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ class NewLoginViewController: UIViewController{
4545
}
4646
}
4747

48+
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
49+
super.viewWillTransition(to: size, with: coordinator)
50+
self.view.setNeedsDisplay()
51+
}
52+
4853
@objc func hideKeyboard(){
4954
self.usernameTextField.endEditing(true)
5055
}
@@ -289,7 +294,8 @@ class NewLoginViewController: UIViewController{
289294
}
290295

291296
@IBAction func didPressContactSupport(sender: Any) {
292-
goToUrl(url: "https://criptext.com/\(Env.language)/contact")
297+
let appVersionString: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
298+
goToUrl(url: "https://criptext.com/\(Env.language)/contact?version=\(appVersionString.trimmed)&device=\(UIDevice.modelName)&os=\(UIDevice.current.systemVersion)".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)
293299
}
294300

295301
@IBAction func didPressClose(sender: Any) {

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ class SignUpViewController: UIViewController{
8181
emailTextField.keyboardToolbar.doneBarButton.setTarget(self, action: #selector(onDonePress(_:)))
8282
}
8383

84+
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
85+
super.viewWillTransition(to: size, with: coordinator)
86+
self.view.setNeedsDisplay()
87+
}
88+
8489
func supportButtonInit(){
8590
let boldText = String.localize("CONTACT_SUPPORT")
8691
let attrs = [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 17), NSAttributedString.Key.foregroundColor : UIColor.white]
@@ -139,7 +144,8 @@ class SignUpViewController: UIViewController{
139144
}
140145

141146
@IBAction func didPressContactSupport(sender: Any) {
142-
goToUrl(url: "https://criptext.com/\(Env.language)/contact")
147+
let appVersionString: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
148+
goToUrl(url: "https://criptext.com/\(Env.language)/contact?version=\(appVersionString)&device=\(UIDevice.modelName)&os=\(UIDevice.current.systemVersion)".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)
143149
}
144150

145151
@IBAction func didPressTermsAndConditions(sender: Any) {

iOS-Email-Client/Info.plist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.1.18</string>
20+
<string>1.1.19</string>
2121
<key>CFBundleURLTypes</key>
2222
<array>
2323
<dict>
@@ -94,6 +94,8 @@
9494
<array>
9595
<string>UIInterfaceOrientationPortrait</string>
9696
<string>UIInterfaceOrientationPortraitUpsideDown</string>
97+
<string>UIInterfaceOrientationLandscapeLeft</string>
98+
<string>UIInterfaceOrientationLandscapeRight</string>
9799
</array>
98100
<key>UIViewControllerBasedStatusBarAppearance</key>
99101
<false/>

iOS-Email-Client/Managers/DBManager.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,13 @@ class DBManager: SharedDB {
768768
guard let email = realm.objects(Email.self).filter("key == \(key)").first else {
769769
continue
770770
}
771+
if(addedLabelNames.contains(SystemLabel.spam.nameId)){
772+
let predicate = NSPredicate(format: "email == '\(email.fromContact.email)'")
773+
let contact = realm.objects(Contact.self).filter(predicate).first
774+
if(contact != nil){
775+
contact?.spamScore += 1
776+
}
777+
}
771778
self.addRemoveLabels(realm: realm, email: email, addedLabelNames: addedLabelNames, removedLabelNames: removedLabelNames)
772779
}
773780
}
@@ -781,6 +788,13 @@ class DBManager: SharedDB {
781788
let predicate = NSPredicate(format: "threadId == %@", threadId)
782789
let emails = realm.objects(Email.self).filter(predicate)
783790
for email in emails {
791+
if(addedLabelNames.contains(SystemLabel.spam.nameId)){
792+
let predicate = NSPredicate(format: "email == '\(email.fromContact.email)'")
793+
let contact = realm.objects(Contact.self).filter(predicate).first
794+
if(contact != nil){
795+
contact?.spamScore += 1
796+
}
797+
}
784798
self.addRemoveLabels(realm: realm, email: email, addedLabelNames: addedLabelNames, removedLabelNames: removedLabelNames)
785799
}
786800
}

iOS-Email-Client/Shared/NewEmailHandler.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ class NewEmailHandler {
162162
from = (from.isEmpty ? ContactUtils.parseFromContact(contact: $0, account: myAccount) : "\(from), \(ContactUtils.parseFromContact(contact: $0, account: myAccount))")
163163
}
164164
email.fromAddress = from
165+
let fromContact = self.database.getContact(ContactUtils.parseContact(from, account: myAccount).email)
166+
if(fromContact != nil){
167+
if(fromContact?.spamScore ?? 0 >= 2){
168+
let spamLabel = SharedDB.getLabel(SystemLabel.spam.id)
169+
email.labels.append(spamLabel!)
170+
}
171+
}
165172
guard self.database.store(email) else {
166173
completion(Result(success: true))
167174
return

iOS-Email-Client/Snackbar/CriptextSnackbarController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ class CriptextSnackbarController : SnackbarController {
7272
}
7373

7474
override func reload() {
75+
super.reload()
7576
customSnackbar.frame.origin.x = snackbarEdgeInsets.left
7677
customSnackbar.frame.size.width = view.bounds.width - snackbarEdgeInsets.left - snackbarEdgeInsets.right
7778
rootViewController.view.frame = view.bounds

0 commit comments

Comments
 (0)