|
|
@ -147,10 +147,9 @@ extension ConversationVC:
|
|
|
|
self.viewModel.threadData.threadIsBlocked == true
|
|
|
|
self.viewModel.threadData.threadIsBlocked == true
|
|
|
|
else { return false }
|
|
|
|
else { return false }
|
|
|
|
|
|
|
|
|
|
|
|
let message = String(
|
|
|
|
let message = "blockUnblockDescription"
|
|
|
|
format: "blockUnblockDescription".localized(),
|
|
|
|
.put(key: "name", value: self.viewModel.threadData.displayName)
|
|
|
|
self.viewModel.threadData.displayName
|
|
|
|
.localized()
|
|
|
|
)
|
|
|
|
|
|
|
|
let confirmationModal: ConfirmationModal = ConfirmationModal(
|
|
|
|
let confirmationModal: ConfirmationModal = ConfirmationModal(
|
|
|
|
info: ConfirmationModal.Info(
|
|
|
|
info: ConfirmationModal.Info(
|
|
|
|
title: String(
|
|
|
|
title: String(
|
|
|
@ -900,7 +899,7 @@ extension ConversationVC:
|
|
|
|
guard cellViewModel.variant != .infoDisappearingMessagesUpdate else {
|
|
|
|
guard cellViewModel.variant != .infoDisappearingMessagesUpdate else {
|
|
|
|
let messageDisappearingConfig = cellViewModel.messageDisappearingConfiguration()
|
|
|
|
let messageDisappearingConfig = cellViewModel.messageDisappearingConfiguration()
|
|
|
|
let expirationTimerString: String = floor(messageDisappearingConfig.durationSeconds).formatted(format: .long)
|
|
|
|
let expirationTimerString: String = floor(messageDisappearingConfig.durationSeconds).formatted(format: .long)
|
|
|
|
let expirationTypeString: String = (messageDisappearingConfig.type == .disappearAfterRead ? "read".localized().lowercased() : "disappearingMessagesSent".localized().lowercased())
|
|
|
|
let expirationTypeString: String = (messageDisappearingConfig.type?.localizedName ?? "")
|
|
|
|
let modalBodyString: String = (
|
|
|
|
let modalBodyString: String = (
|
|
|
|
messageDisappearingConfig.isEnabled ?
|
|
|
|
messageDisappearingConfig.isEnabled ?
|
|
|
|
String(
|
|
|
|
String(
|
|
|
@ -955,16 +954,12 @@ extension ConversationVC:
|
|
|
|
|
|
|
|
|
|
|
|
// If it's an incoming media message and the thread isn't trusted then show the placeholder view
|
|
|
|
// If it's an incoming media message and the thread isn't trusted then show the placeholder view
|
|
|
|
if cellViewModel.cellType != .textOnlyMessage && cellViewModel.variant == .standardIncoming && !cellViewModel.threadIsTrusted {
|
|
|
|
if cellViewModel.cellType != .textOnlyMessage && cellViewModel.variant == .standardIncoming && !cellViewModel.threadIsTrusted {
|
|
|
|
let message: String = String(
|
|
|
|
let message: String = "attachmentsAutoDownloadModalDescription"
|
|
|
|
format: "attachmentsAutoDownloadModalDescription".localized(),
|
|
|
|
.put(key: "conversationname", value: cellViewModel.authorName)
|
|
|
|
cellViewModel.authorName
|
|
|
|
.localized()
|
|
|
|
)
|
|
|
|
|
|
|
|
let confirmationModal: ConfirmationModal = ConfirmationModal(
|
|
|
|
let confirmationModal: ConfirmationModal = ConfirmationModal(
|
|
|
|
info: ConfirmationModal.Info(
|
|
|
|
info: ConfirmationModal.Info(
|
|
|
|
title: String(
|
|
|
|
title: "attachmentsAutoDownloadModalTitle".localized(),
|
|
|
|
format: "attachmentsAutoDownloadModalTitle".localized(),
|
|
|
|
|
|
|
|
cellViewModel.authorName
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
body: .attributedText(
|
|
|
|
body: .attributedText(
|
|
|
|
NSAttributedString(string: message)
|
|
|
|
NSAttributedString(string: message)
|
|
|
|
.adding(
|
|
|
|
.adding(
|
|
|
@ -1211,7 +1206,9 @@ extension ConversationVC:
|
|
|
|
// URLs can be unsafe, so always ask the user whether they want to open one
|
|
|
|
// URLs can be unsafe, so always ask the user whether they want to open one
|
|
|
|
let actionSheet: UIAlertController = UIAlertController(
|
|
|
|
let actionSheet: UIAlertController = UIAlertController(
|
|
|
|
title: "urlOpen".localized(),
|
|
|
|
title: "urlOpen".localized(),
|
|
|
|
message: String(format: "urlOpenDescription".localized(), url.absoluteString),
|
|
|
|
message: "urlOpenDescription"
|
|
|
|
|
|
|
|
.put(key: "url", value: url.absoluteString)
|
|
|
|
|
|
|
|
.localized(),
|
|
|
|
preferredStyle: .actionSheet
|
|
|
|
preferredStyle: .actionSheet
|
|
|
|
)
|
|
|
|
)
|
|
|
|
actionSheet.addAction(UIAlertAction(title: "open".localized(), style: .default) { [weak self] _ in
|
|
|
|
actionSheet.addAction(UIAlertAction(title: "open".localized(), style: .default) { [weak self] _ in
|
|
|
@ -2196,7 +2193,7 @@ extension ConversationVC:
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return (cellViewModel.threadId == userPublicKey ?
|
|
|
|
return (cellViewModel.threadId == userPublicKey ?
|
|
|
|
"delete_message_for_me_and_my_devices".localized() :
|
|
|
|
"delete_message_for_me_and_my_devices".localized() :
|
|
|
|
String(format: "clearMessagesForEveryone".localized(), threadName)
|
|
|
|
"clearMessagesForEveryone".localized()
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}(),
|
|
|
|
}(),
|
|
|
|