Add non-encrypted header to conversation

This commit is contained in:
Benoit Martins 2026-02-24 15:58:21 +01:00
parent 5bbbbe5d75
commit ca9f5ffe1f
9 changed files with 43 additions and 34 deletions

View file

@ -1,21 +0,0 @@
{
"images" : [
{
"filename" : "lock-simple-open-bold.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M208,76H100V56a28,28,0,0,1,28-28c13.51,0,25.65,9.62,28.24,22.39a12,12,0,1,0,23.52-4.78C174.87,21.5,153.1,4,128,4A52.06,52.06,0,0,0,76,56V76H48A20,20,0,0,0,28,96V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V96A20,20,0,0,0,208,76Zm-4,128H52V100H204Z"></path></svg>

Before

Width:  |  Height:  |  Size: 370 B

View file

@ -1 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M208,80H96V56a32,32,0,0,1,32-32c15.37,0,29.2,11,32.16,25.59a8,8,0,0,0,15.68-3.18C171.32,24.15,151.2,8,128,8A48.05,48.05,0,0,0,80,56V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80Zm0,128H48V96H208V208Z"></path></svg> <svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_1_2)">
<path d="M208 88H48C43.5817 88 40 91.5817 40 96V208C40 212.418 43.5817 216 48 216H208C212.418 216 216 212.418 216 208V96C216 91.5817 212.418 88 208 88Z" stroke="black" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M88 88V56C88 45.3913 83.7857 35.2172 76.2843 27.7157C68.7828 20.2143 58.6087 16 48 16C28.65 16 11.71 29.74 8 48" stroke="black" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_1_2">
<rect width="256" height="256" fill="white"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 682 B

View file

@ -2,6 +2,6 @@ import Foundation
public enum AppGitInfo { public enum AppGitInfo {
public static let branch = "master" public static let branch = "master"
public static let commit = "f08bb865a" public static let commit = "5bbbbe5d7"
public static let tag = "6.1.0-alpha" public static let tag = "6.1.0-alpha"
} }

View file

@ -291,6 +291,8 @@
"conversation_pick_file_from_gallery_label" = "Open gallery"; "conversation_pick_file_from_gallery_label" = "Open gallery";
"conversation_pick_any_file_label" = "Pick file"; "conversation_pick_any_file_label" = "Pick file";
"conversation_file_cant_be_opened_error_toast" = "File can't be opened!"; "conversation_file_cant_be_opened_error_toast" = "File can't be opened!";
"conversation_warning_disabled_because_not_secured_title" = "This conversation is not encrypted!";
"conversation_warning_disabled_because_not_secured_subtitle" = "Messages aren't end-to-end encrypted, make sure you don't share sensitive information!";
"debug_logs_copied_to_clipboard_toast" = "Debug logs copied to clipboard"; "debug_logs_copied_to_clipboard_toast" = "Debug logs copied to clipboard";
"Default" = "Default"; "Default" = "Default";
"default_account_disabled" = "Selected account is currently disabled"; "default_account_disabled" = "Selected account is currently disabled";

View file

@ -291,6 +291,8 @@
"conversation_pick_file_from_gallery_label" = "Ouvrir la galerie"; "conversation_pick_file_from_gallery_label" = "Ouvrir la galerie";
"conversation_pick_any_file_label" = "Choisir un fichier"; "conversation_pick_any_file_label" = "Choisir un fichier";
"conversation_file_cant_be_opened_error_toast" = "Impossible d'ouvrir le fichier!"; "conversation_file_cant_be_opened_error_toast" = "Impossible d'ouvrir le fichier!";
"conversation_warning_disabled_because_not_secured_title" = "Cette conversation n'est pas chiffrée !";
"conversation_warning_disabled_because_not_secured_subtitle" = "Les messages ne sont pas chiffrés de bout en bout, assurez-vous de ne pas partager d'informations sensibles !";
"debug_logs_copied_to_clipboard_toast" = "Les journaux ont été ajoutés au presse-papier"; "debug_logs_copied_to_clipboard_toast" = "Les journaux ont été ajoutés au presse-papier";
"Default" = "Default"; "Default" = "Default";
"default_account_disabled" = "Le compte selectionné est désactivé"; "default_account_disabled" = "Le compte selectionné est désactivé";

View file

@ -329,7 +329,7 @@ struct ConversationFragment: View {
.padding(.top, 4) .padding(.top, 4)
.lineLimit(1) .lineLimit(1)
if isMuted || conversationViewModel.ephemeralTime != NSLocalizedString("conversation_ephemeral_messages_duration_disabled", comment: "") { if isMuted || conversationViewModel.ephemeralTime != NSLocalizedString("conversation_ephemeral_messages_duration_disabled", comment: "") || ((SharedMainViewModel.shared.displayedConversation?.encryptionEnabled ?? cachedConversation!.encryptionEnabled) == false) {
HStack { HStack {
if isMuted { if isMuted {
Image("bell-slash") Image("bell-slash")
@ -353,6 +353,22 @@ struct ConversationFragment: View {
.lineLimit(1) .lineLimit(1)
} }
if (SharedMainViewModel.shared.displayedConversation?.encryptionEnabled ?? cachedConversation!.encryptionEnabled) == false {
HStack {
Image("lock-simple-open")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.orangeWarning600)
.frame(width: 16, height: 16, alignment: .trailing)
Text("conversation_warning_disabled_because_not_secured_title")
.foregroundStyle(Color.orangeWarning600)
.default_text_style(styleSize: 12)
.frame(maxWidth: .infinity, alignment: .leading)
.lineLimit(1)
}
}
Spacer() Spacer()
} }
} }

View file

@ -173,11 +173,11 @@ struct ConversationRow: View {
} }
if !conversation.encryptionEnabled { if !conversation.encryptionEnabled {
Image("lock-simple-open-bold") Image("lock-simple-open")
.renderingMode(.template) .renderingMode(.template)
.resizable() .resizable()
.foregroundStyle(Color.orangeWarning600) .foregroundStyle(Color.orangeWarning600)
.frame(width: 18, height: 18, alignment: .trailing) .frame(width: 16, height: 16, alignment: .trailing)
} }
if conversation.isEphemeral { if conversation.isEphemeral {

View file

@ -135,7 +135,7 @@ struct UIList: UIViewRepresentable {
tableView.backgroundColor = UIColor(.white) tableView.backgroundColor = UIColor(.white)
tableView.scrollsToTop = true tableView.scrollsToTop = true
if SharedMainViewModel.shared.displayedConversation != nil && SharedMainViewModel.shared.displayedConversation!.encryptionEnabled { if SharedMainViewModel.shared.displayedConversation != nil {
let footerView = Self.makeFooterView() let footerView = Self.makeFooterView()
footerView.frame = CGRect(x: 0, y: 0, width: tableView.bounds.width, height: 80) footerView.frame = CGRect(x: 0, y: 0, width: tableView.bounds.width, height: 80)
footerView.transform = CGAffineTransformMakeScale(1, -1) footerView.transform = CGAffineTransformMakeScale(1, -1)
@ -180,25 +180,26 @@ struct UIList: UIViewRepresentable {
} }
static func makeFooterView() -> UIView { static func makeFooterView() -> UIView {
let encryptionEnabled = SharedMainViewModel.shared.displayedConversation!.encryptionEnabled
let host = UIHostingController( let host = UIHostingController(
rootView: rootView:
VStack { VStack {
HStack { HStack {
Image("lock-simple-bold") Image(encryptionEnabled ? "lock-simple-bold" : "lock-simple-open")
.renderingMode(.template) .renderingMode(.template)
.resizable() .resizable()
.foregroundStyle(Color.blueInfo500) .foregroundStyle(encryptionEnabled ? Color.blueInfo500 : Color.orangeWarning600)
.frame(width: 25, height: 25) .frame(width: 25, height: 25)
.padding(10) .padding(10)
VStack(spacing: 5) { VStack(spacing: 5) {
Text("conversation_end_to_end_encrypted_event_title") Text(encryptionEnabled ? "conversation_end_to_end_encrypted_event_title" : "conversation_warning_disabled_because_not_secured_title")
.foregroundStyle(Color.blueInfo500) .foregroundStyle(encryptionEnabled ? Color.blueInfo500 : Color.orangeWarning600)
.default_text_style_700(styleSize: 14) .default_text_style_700(styleSize: 14)
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
.multilineTextAlignment(.leading) .multilineTextAlignment(.leading)
Text("conversation_end_to_end_encrypted_event_subtitle") Text(encryptionEnabled ? "conversation_end_to_end_encrypted_event_subtitle" : "conversation_warning_disabled_because_not_secured_subtitle")
.foregroundStyle(Color.gray400) .foregroundStyle(Color.gray400)
.default_text_style(styleSize: 12) .default_text_style(styleSize: 12)
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
@ -210,7 +211,7 @@ struct UIList: UIViewRepresentable {
.overlay( .overlay(
RoundedRectangle(cornerRadius: 10) RoundedRectangle(cornerRadius: 10)
.inset(by: 0.5) .inset(by: 0.5)
.stroke(Color.blueInfo500, lineWidth: 0.5) .stroke(encryptionEnabled ? Color.blueInfo500 : Color.orangeWarning600, lineWidth: 0.5)
) )
.padding(.horizontal, 10) .padding(.horizontal, 10)
} }