Skip to content

Commit c3759b3

Browse files
committed
fixes
1 parent 76ce79f commit c3759b3

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

ShareExtension/ComposerUIView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class ComposerUIView: UIView {
137137
}
138138

139139
func setFrom(account: Account) {
140-
let accounts = Array(SharedDB.getAccounts(ignore: account.username))
140+
let accounts = Array(SharedDB.getAccounts(ignore: account.compoundKey))
141141
fromButton.isHidden = accounts.count == 0
142142
let attributedFrom = NSMutableAttributedString(string: "\(String.localize("FROM")): ", attributes: [.font: Font.bold.size(15)!])
143143
let attributedEmail = NSAttributedString(string: account.email, attributes: [.font: Font.regular.size(15)!])

iOS-Email-Client/Controllers/ComposeViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class ComposeViewController: UIViewController {
233233
}
234234

235235
func setFrom(account: Account) {
236-
let accounts = Array(DBManager.getAccounts(ignore: account.username))
236+
let accounts = Array(DBManager.getAccounts(ignore: account.compoundKey))
237237
fromButton.isHidden = accounts.count == 0 || (composerData.threadId != nil && composerData.threadId != composerData.emailDraft?.key.description)
238238
fromButton.setImage(UIImage(named: "icon-down"), for: .normal)
239239
activeAccount = account

iOS-Email-Client/Interfaces/EmailMoreOptionsInterface.swift

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class EmailMoreOptionsInterface: MoreOptionsViewInterface {
2929
case forward
3030
case delete
3131
case mark
32+
case notSpam
3233
case spam
3334
case unsend
3435
case print
@@ -47,8 +48,10 @@ class EmailMoreOptionsInterface: MoreOptionsViewInterface {
4748
return String.localize("DELETE")
4849
case .mark:
4950
return String.localize("MARK_FROM_HERE")
51+
case .notSpam:
52+
return String.localize("REMOVE_SPAM")
5053
case .spam:
51-
return String.localize("SPAM")
54+
return String.localize("MARK_SPAM")
5255
case .unsend:
5356
return String.localize("UNSEND")
5457
case .print:
@@ -66,8 +69,15 @@ class EmailMoreOptionsInterface: MoreOptionsViewInterface {
6669
var delegate: EmailMoreOptionsInterfaceDelegate?
6770

6871
init(email: Email) {
69-
options = [.reply, .replyAll, .delete, .mark, .spam]
70-
optionsCount = 5
72+
options = [.reply, .replyAll, .delete, .mark]
73+
optionsCount = 4
74+
if (email.isSpam) {
75+
options.append(.notSpam)
76+
optionsCount += 1
77+
} else {
78+
options.append(.spam)
79+
optionsCount += 1
80+
}
7181
if (email.secure && email.status != .unsent && email.status != .none && email.status != .sending && email.status != .fail) {
7282
options.append(.unsend)
7383
optionsCount += 1
@@ -106,6 +116,8 @@ class EmailMoreOptionsInterface: MoreOptionsViewInterface {
106116
delegate?.onDeletePress()
107117
case .mark:
108118
delegate?.onMarkPress()
119+
case .notSpam:
120+
delegate?.onSpamPress()
109121
case .spam:
110122
delegate?.onSpamPress()
111123
case .unsend:

iOS-Email-Client/Libs/Env.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct Env {
4949
guard !Env.isProduction else {
5050
return "wss://socket.criptext.com"
5151
}
52-
return "wss://windowsocket.criptext.com"
52+
return "wss://socket.criptext.com"
5353
}
5454

5555
static var domain: String {

iOS-Email-Client/Shared/SharedDB.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class SharedDB {
4545
return realm?.object(ofType: Account.self, forPrimaryKey: id)
4646
}
4747

48-
class func getAccounts(ignore username: String) -> Results<Account> {
48+
class func getAccounts(ignore accountId: String) -> Results<Account> {
4949
let realm = try! Realm()
50-
return realm.objects(Account.self).filter("isLoggedIn == true AND username != '\(username)'")
50+
return realm.objects(Account.self).filter("isLoggedIn == true AND compoundKey != '\(accountId)'")
5151
}
5252

5353
class func getAllAccounts() -> [Account] {

0 commit comments

Comments
 (0)