ios: UI to filter favorite and unread chats (#2592)

* ios: UI to filter favorite and unread chats

* update localizations

* update colors

* star size and position

* filter button sizes and layout

* change AND to OR when both filters are chosen

* simplify filter UX

* store filter state in defaults

* remove comment, update localizations
This commit is contained in:
Evgeny Poberezkin 2023-06-19 11:13:30 +01:00 committed by GitHub
parent 5c105cb746
commit ddf81d28f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 185 additions and 109 deletions

View file

@ -583,6 +583,14 @@ final class Chat: ObservableObject, Identifiable {
self.chatStats = chatStats
}
func copy(chatInfo: ChatInfo? = nil, chatItems: [ChatItem]? = nil, chatStats: ChatStats? = nil) -> Chat {
Chat(
chatInfo: chatInfo ?? self.chatInfo,
chatItems: chatItems ?? self.chatItems,
chatStats: chatStats ?? self.chatStats
)
}
var userCanSend: Bool {
switch chatInfo {
case .direct: return true

View file

@ -884,7 +884,9 @@ func markChatRead(_ chat: Chat, aboveItem: ChatItem? = nil) async {
let itemRange = (minItemId, aboveItem?.id ?? chat.chatItems.last?.id ?? minItemId)
let cInfo = chat.chatInfo
try await apiChatRead(type: cInfo.chatType, id: cInfo.apiId, itemRange: itemRange)
await MainActor.run { ChatModel.shared.markChatItemsRead(cInfo, aboveItem: aboveItem) }
await MainActor.run {
withAnimation { ChatModel.shared.markChatItemsRead(cInfo, aboveItem: aboveItem) }
}
}
if chat.chatStats.unreadChat {
await markChatUnread(chat, unreadChat: false)
@ -898,7 +900,9 @@ func markChatUnread(_ chat: Chat, unreadChat: Bool = true) async {
do {
let cInfo = chat.chatInfo
try await apiChatUnread(type: cInfo.chatType, id: cInfo.apiId, unreadChat: unreadChat)
await MainActor.run { ChatModel.shared.markChatUnread(cInfo, unreadChat: unreadChat) }
await MainActor.run {
withAnimation { ChatModel.shared.markChatUnread(cInfo, unreadChat: unreadChat) }
}
} catch {
logger.error("markChatUnread apiChatUnread error: \(responseError(error))")
}

View file

@ -897,9 +897,20 @@ struct ChatView: View {
}
func toggleNotifications(_ chat: Chat, enableNtfs: Bool) {
var chatSettings = chat.chatInfo.chatSettings ?? ChatSettings.defaults
chatSettings.enableNtfs = enableNtfs
updateChatSettings(chat, chatSettings: chatSettings)
}
func toggleChatFavorite(_ chat: Chat, favorite: Bool) {
var chatSettings = chat.chatInfo.chatSettings ?? ChatSettings.defaults
chatSettings.favorite = favorite
updateChatSettings(chat, chatSettings: chatSettings)
}
func updateChatSettings(_ chat: Chat, chatSettings: ChatSettings) {
Task {
do {
let chatSettings = ChatSettings(enableNtfs: enableNtfs)
try await apiSetChatSettings(type: chat.chatInfo.chatType, id: chat.chatInfo.apiId, chatSettings: chatSettings)
await MainActor.run {
switch chat.chatInfo {

View file

@ -27,7 +27,7 @@ private let rowHeights: [DynamicTypeSize: CGFloat] = [
struct ChatListNavLink: View {
@EnvironmentObject var chatModel: ChatModel
@Environment(\.dynamicTypeSize) private var dynamicTypeSize
@State var chat: Chat
@ObservedObject var chat: Chat
@State private var showContactRequestDialog = false
@State private var showJoinGroupDialog = false
@State private var showContactConnectionInfo = false
@ -57,6 +57,8 @@ struct ChatListNavLink: View {
)
.swipeActions(edge: .leading, allowsFullSwipe: true) {
markReadButton()
toggleFavoriteButton()
toggleNtfsButton(chat)
}
.swipeActions(edge: .trailing, allowsFullSwipe: true) {
if !chat.chatItems.isEmpty {
@ -126,6 +128,8 @@ struct ChatListNavLink: View {
.frame(height: rowHeights[dynamicTypeSize])
.swipeActions(edge: .leading, allowsFullSwipe: true) {
markReadButton()
toggleFavoriteButton()
toggleNtfsButton(chat)
}
.swipeActions(edge: .trailing, allowsFullSwipe: true) {
if !chat.chatItems.isEmpty {
@ -134,8 +138,6 @@ struct ChatListNavLink: View {
if (groupInfo.membership.memberCurrent) {
leaveGroupChatButton(groupInfo)
}
}
.swipeActions(edge: .trailing) {
if groupInfo.canDelete {
deleteGroupChatButton(groupInfo)
}
@ -171,6 +173,24 @@ struct ChatListNavLink: View {
}
@ViewBuilder private func toggleFavoriteButton() -> some View {
if chat.chatInfo.chatSettings?.favorite == true {
Button {
toggleChatFavorite(chat, favorite: false)
} label: {
Label("Unfav.", systemImage: "star.slash")
}
.tint(.green)
} else {
Button {
toggleChatFavorite(chat, favorite: true)
} label: {
Label("Favorite", systemImage: "star.fill")
}
.tint(.green)
}
}
private func clearChatButton() -> some View {
Button {
AlertManager.shared.showAlert(clearChatAlert())

View file

@ -14,7 +14,8 @@ struct ChatListView: View {
@Binding var showSettings: Bool
@State private var searchText = ""
@State private var showAddChat = false
@State var userPickerVisible = false
@State private var userPickerVisible = false
@AppStorage(DEFAULT_SHOW_UNREAD_AND_FAVORITES) private var showUnreadAndFavorites = false
var body: some View {
ZStack(alignment: .topLeading) {
@ -56,7 +57,6 @@ struct ChatListView: View {
.onDisappear() { withAnimation { userPickerVisible = false } }
.offset(x: -8)
.listStyle(.plain)
.navigationTitle("Your chats")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
@ -84,17 +84,19 @@ struct ChatListView: View {
}
}
ToolbarItem(placement: .principal) {
HStack(spacing: 4) {
if (chatModel.incognito) {
HStack {
if (chatModel.chats.count > 8) {
Text("Your chats").font(.headline)
Spacer().frame(width: 16)
Image(systemName: "theatermasks")
.foregroundColor(.indigo)
.padding(.trailing, 8)
}
Image(systemName: "theatermasks").frame(maxWidth: 24, maxHeight: 24, alignment: .center).foregroundColor(.indigo)
Text("Chats")
.font(.headline)
if chatModel.chats.count > 0 {
toggleFilterButton()
}
} else {
Text("Your chats").font(.headline)
}
.frame(maxWidth: .infinity, alignment: .center)
}
ToolbarItem(placement: .navigationBarTrailing) {
switch chatModel.chatRunning {
@ -106,6 +108,15 @@ struct ChatListView: View {
}
}
private func toggleFilterButton() -> some View {
Button {
showUnreadAndFavorites = !showUnreadAndFavorites
} label: {
Image(systemName: "line.3.horizontal.decrease.circle" + (showUnreadAndFavorites ? ".fill" : ""))
.foregroundColor(.accentColor)
}
}
private var chatList: some View {
List {
ForEach(filteredChats(), id: \.viewId) { chat in
@ -181,10 +192,12 @@ struct ChatListView: View {
private func filteredChats() -> [Chat] {
let s = searchText.trimmingCharacters(in: .whitespaces).localizedLowercase
return s == ""
return s == "" && !showUnreadAndFavorites
? chatModel.chats
: chatModel.chats.filter { chat in
let contains = chat.chatInfo.chatViewName.localizedLowercase.contains(s)
let contains = s == ""
? ((chat.chatInfo.chatSettings?.favorite ?? false) || chat.chatStats.unreadCount > 0 || chat.chatStats.unreadChat)
: chat.chatInfo.chatViewName.localizedLowercase.contains(s)
switch chat.chatInfo {
case let .direct(contact):
return contains

View file

@ -126,6 +126,13 @@ struct ChatPreviewView: View {
} else if !chat.chatInfo.ntfsEnabled {
Image(systemName: "speaker.slash.fill")
.foregroundColor(.secondary)
} else if chat.chatInfo.chatSettings?.favorite ?? false {
Image(systemName: "star.fill")
.resizable()
.scaledToFill()
.frame(width: 18, height: 18)
.padding(.trailing, 1)
.foregroundColor(.secondary.opacity(0.65))
}
}
}

View file

@ -49,6 +49,7 @@ let DEFAULT_SHOW_MUTE_PROFILE_ALERT = "showMuteProfileAlert"
let DEFAULT_WHATS_NEW_VERSION = "defaultWhatsNewVersion"
let DEFAULT_ONBOARDING_STAGE = "onboardingStage"
let DEFAULT_CUSTOM_DISAPPEARING_MESSAGE_TIME = "customDisappearingMessageTime"
let DEFAULT_SHOW_UNREAD_AND_FAVORITES = "showUnreadAndFavorites"
let appDefaults: [String: Any] = [
DEFAULT_SHOW_LA_NOTICE: false,
@ -78,6 +79,7 @@ let appDefaults: [String: Any] = [
DEFAULT_SHOW_MUTE_PROFILE_ALERT: true,
DEFAULT_ONBOARDING_STAGE: OnboardingStage.onboardingComplete.rawValue,
DEFAULT_CUSTOM_DISAPPEARING_MESSAGE_TIME: 300,
DEFAULT_SHOW_UNREAD_AND_FAVORITES: false
]
enum SimpleXLinkMode: String, Identifiable {

View file

@ -2040,6 +2040,10 @@
<target>Rychle a bez čekání, než bude odesílatel online!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Favorite" xml:space="preserve">
<source>Favorite</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="File will be deleted from servers." xml:space="preserve">
<source>File will be deleted from servers.</source>
<target>Soubor bude smazán ze serverů.</target>
@ -4415,6 +4419,10 @@ Před zapnutím této funkce budete vyzváni k dokončení ověření.</target>
<target>Neočekávaný stav přenášení</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unfav." xml:space="preserve">
<source>Unfav.</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unhide" xml:space="preserve">
<source>Unhide</source>
<target>Odkrýt</target>
@ -4972,11 +4980,6 @@ Chcete-li se připojit, požádejte svůj kontakt o vytvoření dalšího odkazu
<target>Vaše chat profily</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your chats" xml:space="preserve">
<source>Your chats</source>
<target>Vaše konverzace</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your contact needs to be online for the connection to complete.&#10;You can cancel this connection and remove the contact (and try later with a new link)." xml:space="preserve">
<source>Your contact needs to be online for the connection to complete.
You can cancel this connection and remove the contact (and try later with a new link).</source>

View file

@ -2040,6 +2040,10 @@
<target>Schnell und ohne warten auf den Absender, bis er online ist!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Favorite" xml:space="preserve">
<source>Favorite</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="File will be deleted from servers." xml:space="preserve">
<source>File will be deleted from servers.</source>
<target>Die Datei wird von den Servern gelöscht.</target>
@ -4415,6 +4419,10 @@ Sie werden aufgefordert, die Authentifizierung abzuschließen, bevor diese Funkt
<target>Unerwarteter Migrationsstatus</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unfav." xml:space="preserve">
<source>Unfav.</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unhide" xml:space="preserve">
<source>Unhide</source>
<target>Verbergen aufheben</target>
@ -4972,11 +4980,6 @@ Bitten Sie Ihren Kontakt darum einen weiteren Verbindungs-Link zu erzeugen, um s
<target>Meine Chat-Profile</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your chats" xml:space="preserve">
<source>Your chats</source>
<target>Meine Chats</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your contact needs to be online for the connection to complete.&#10;You can cancel this connection and remove the contact (and try later with a new link)." xml:space="preserve">
<source>Your contact needs to be online for the connection to complete.
You can cancel this connection and remove the contact (and try later with a new link).</source>

View file

@ -2040,6 +2040,11 @@
<target>Fast and no wait until the sender is online!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Favorite" xml:space="preserve">
<source>Favorite</source>
<target>Favorite</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="File will be deleted from servers." xml:space="preserve">
<source>File will be deleted from servers.</source>
<target>File will be deleted from servers.</target>
@ -4416,6 +4421,11 @@ You will be prompted to complete authentication before this feature is enabled.<
<target>Unexpected migration state</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unfav." xml:space="preserve">
<source>Unfav.</source>
<target>Unfav.</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unhide" xml:space="preserve">
<source>Unhide</source>
<target>Unhide</target>
@ -4973,11 +4983,6 @@ To connect, please ask your contact to create another connection link and check
<target>Your chat profiles</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your chats" xml:space="preserve">
<source>Your chats</source>
<target>Your chats</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your contact needs to be online for the connection to complete.&#10;You can cancel this connection and remove the contact (and try later with a new link)." xml:space="preserve">
<source>Your contact needs to be online for the connection to complete.
You can cancel this connection and remove the contact (and try later with a new link).</source>

View file

@ -2040,6 +2040,10 @@
<target>¡Rápido y sin necesidad de esperar a que el remitente esté en línea!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Favorite" xml:space="preserve">
<source>Favorite</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="File will be deleted from servers." xml:space="preserve">
<source>File will be deleted from servers.</source>
<target>El archivo será eliminado de los servidores.</target>
@ -4415,6 +4419,10 @@ Se te pedirá que completes la autenticación antes de activar esta función.</t
<target>Estado de migración inesperado</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unfav." xml:space="preserve">
<source>Unfav.</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unhide" xml:space="preserve">
<source>Unhide</source>
<target>Mostrar</target>
@ -4973,11 +4981,6 @@ Para conectarte, pide a tu contacto que cree otro enlace de conexión y comprueb
<target>Mis perfiles</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your chats" xml:space="preserve">
<source>Your chats</source>
<target>Mis chats</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your contact needs to be online for the connection to complete.&#10;You can cancel this connection and remove the contact (and try later with a new link)." xml:space="preserve">
<source>Your contact needs to be online for the connection to complete.
You can cancel this connection and remove the contact (and try later with a new link).</source>

View file

@ -2040,6 +2040,10 @@
<target>Rapide et ne nécessitant pas d'attendre que l'expéditeur soit en ligne !</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Favorite" xml:space="preserve">
<source>Favorite</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="File will be deleted from servers." xml:space="preserve">
<source>File will be deleted from servers.</source>
<target>Le fichier sera supprimé des serveurs.</target>
@ -4415,6 +4419,10 @@ Vous serez invité à confirmer l'authentification avant que cette fonction ne s
<target>État de la migration inattendu</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unfav." xml:space="preserve">
<source>Unfav.</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unhide" xml:space="preserve">
<source>Unhide</source>
<target>Dévoiler</target>
@ -4972,11 +4980,6 @@ Pour vous connecter, veuillez demander à votre contact de créer un autre lien
<target>Vos profils de chat</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your chats" xml:space="preserve">
<source>Your chats</source>
<target>Vos chats</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your contact needs to be online for the connection to complete.&#10;You can cancel this connection and remove the contact (and try later with a new link)." xml:space="preserve">
<source>Your contact needs to be online for the connection to complete.
You can cancel this connection and remove the contact (and try later with a new link).</source>

View file

@ -2040,6 +2040,10 @@
<target>Veloce e senza aspettare che il mittente sia in linea!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Favorite" xml:space="preserve">
<source>Favorite</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="File will be deleted from servers." xml:space="preserve">
<source>File will be deleted from servers.</source>
<target>Il file verrà eliminato dai server.</target>
@ -4415,6 +4419,10 @@ Ti verrà chiesto di completare l'autenticazione prima di attivare questa funzio
<target>Stato di migrazione imprevisto</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unfav." xml:space="preserve">
<source>Unfav.</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unhide" xml:space="preserve">
<source>Unhide</source>
<target>Svela</target>
@ -4972,11 +4980,6 @@ Per connetterti, chiedi al tuo contatto di creare un altro link di connessione e
<target>I tuoi profili di chat</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your chats" xml:space="preserve">
<source>Your chats</source>
<target>Le tue chat</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your contact needs to be online for the connection to complete.&#10;You can cancel this connection and remove the contact (and try later with a new link)." xml:space="preserve">
<source>Your contact needs to be online for the connection to complete.
You can cancel this connection and remove the contact (and try later with a new link).</source>

View file

@ -2039,6 +2039,10 @@
<target>送信者がオンラインになるまでの待ち時間がなく、速い!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Favorite" xml:space="preserve">
<source>Favorite</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="File will be deleted from servers." xml:space="preserve">
<source>File will be deleted from servers.</source>
<target>ファイルはサーバーから削除されます。</target>
@ -4413,6 +4417,10 @@ You will be prompted to complete authentication before this feature is enabled.<
<target>予期しない移行状態</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unfav." xml:space="preserve">
<source>Unfav.</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unhide" xml:space="preserve">
<source>Unhide</source>
<target>表示にする</target>
@ -4970,11 +4978,6 @@ To connect, please ask your contact to create another connection link and check
<target>あなたのチャットプロフィール</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your chats" xml:space="preserve">
<source>Your chats</source>
<target>あなたのチャット</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your contact needs to be online for the connection to complete.&#10;You can cancel this connection and remove the contact (and try later with a new link)." xml:space="preserve">
<source>Your contact needs to be online for the connection to complete.
You can cancel this connection and remove the contact (and try later with a new link).</source>

View file

@ -2040,6 +2040,10 @@
<target>Snel en niet wachten tot de afzender online is!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Favorite" xml:space="preserve">
<source>Favorite</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="File will be deleted from servers." xml:space="preserve">
<source>File will be deleted from servers.</source>
<target>Het bestand wordt van de servers verwijderd.</target>
@ -4415,6 +4419,10 @@ U wordt gevraagd de authenticatie te voltooien voordat deze functie wordt ingesc
<target>Onverwachte migratiestatus</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unfav." xml:space="preserve">
<source>Unfav.</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unhide" xml:space="preserve">
<source>Unhide</source>
<target>zichtbaar maken</target>
@ -4972,11 +4980,6 @@ Om verbinding te maken, vraagt u uw contactpersoon om een andere verbinding link
<target>Uw chat profielen</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your chats" xml:space="preserve">
<source>Your chats</source>
<target>Jouw gesprekken</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your contact needs to be online for the connection to complete.&#10;You can cancel this connection and remove the contact (and try later with a new link)." xml:space="preserve">
<source>Your contact needs to be online for the connection to complete.
You can cancel this connection and remove the contact (and try later with a new link).</source>

View file

@ -2040,6 +2040,10 @@
<target>Szybko i bez czekania aż nadawca będzie online!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Favorite" xml:space="preserve">
<source>Favorite</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="File will be deleted from servers." xml:space="preserve">
<source>File will be deleted from servers.</source>
<target>Plik zostanie usunięty z serwerów.</target>
@ -4415,6 +4419,10 @@ Przed włączeniem tej funkcji zostanie wyświetlony monit uwierzytelniania.</ta
<target>Nieoczekiwany stan migracji</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unfav." xml:space="preserve">
<source>Unfav.</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unhide" xml:space="preserve">
<source>Unhide</source>
<target>Odkryj</target>
@ -4972,11 +4980,6 @@ Aby się połączyć, poproś Twój kontakt o utworzenie kolejnego linku połąc
<target>Twoje profile czatu</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your chats" xml:space="preserve">
<source>Your chats</source>
<target>Twoje czaty</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your contact needs to be online for the connection to complete.&#10;You can cancel this connection and remove the contact (and try later with a new link)." xml:space="preserve">
<source>Your contact needs to be online for the connection to complete.
You can cancel this connection and remove the contact (and try later with a new link).</source>

View file

@ -2040,6 +2040,10 @@
<target>Быстрые и не нужно ждать, когда отправитель онлайн!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Favorite" xml:space="preserve">
<source>Favorite</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="File will be deleted from servers." xml:space="preserve">
<source>File will be deleted from servers.</source>
<target>Файл будет удалён с серверов.</target>
@ -4415,6 +4419,10 @@ You will be prompted to complete authentication before this feature is enabled.<
<target>Неожиданная ошибка при перемещении данных чата</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unfav." xml:space="preserve">
<source>Unfav.</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unhide" xml:space="preserve">
<source>Unhide</source>
<target>Раскрыть</target>
@ -4972,11 +4980,6 @@ To connect, please ask your contact to create another connection link and check
<target>Ваши профили чата</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your chats" xml:space="preserve">
<source>Your chats</source>
<target>Ваши чаты</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your contact needs to be online for the connection to complete.&#10;You can cancel this connection and remove the contact (and try later with a new link)." xml:space="preserve">
<source>Your contact needs to be online for the connection to complete.
You can cancel this connection and remove the contact (and try later with a new link).</source>

View file

@ -2040,6 +2040,10 @@
<target>快速且无需等待发件人在线!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Favorite" xml:space="preserve">
<source>Favorite</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="File will be deleted from servers." xml:space="preserve">
<source>File will be deleted from servers.</source>
<target>文件将从服务器中删除。</target>
@ -4415,6 +4419,10 @@ You will be prompted to complete authentication before this feature is enabled.<
<target>未预料的迁移状态</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unfav." xml:space="preserve">
<source>Unfav.</source>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Unhide" xml:space="preserve">
<source>Unhide</source>
<target>取消隐藏</target>
@ -4972,11 +4980,6 @@ To connect, please ask your contact to create another connection link and check
<target>您的聊天资料</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your chats" xml:space="preserve">
<source>Your chats</source>
<target>您的聊天</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Your contact needs to be online for the connection to complete.&#10;You can cancel this connection and remove the contact (and try later with a new link)." xml:space="preserve">
<source>Your contact needs to be online for the connection to complete.
You can cancel this connection and remove the contact (and try later with a new link).</source>

View file

@ -1072,12 +1072,14 @@ public struct KeepAliveOpts: Codable, Equatable {
public struct ChatSettings: Codable {
public var enableNtfs: Bool
public var favorite: Bool? = false
public init(enableNtfs: Bool) {
public init(enableNtfs: Bool, favorite: Bool?) {
self.enableNtfs = enableNtfs
self.favorite = favorite
}
public static let defaults: ChatSettings = ChatSettings(enableNtfs: true)
public static let defaults: ChatSettings = ChatSettings(enableNtfs: true, favorite: false)
}
public struct ConnectionStats: Codable {

View file

@ -1240,10 +1240,14 @@ public enum ChatInfo: Identifiable, Decodable, NamedChat {
}
public var ntfsEnabled: Bool {
self.chatSettings?.enableNtfs ?? false
}
public var chatSettings: ChatSettings? {
switch self {
case let .direct(contact): return contact.chatSettings.enableNtfs
case let .group(groupInfo): return groupInfo.chatSettings.enableNtfs
default: return false
case let .direct(contact): return contact.chatSettings
case let .group(groupInfo): return groupInfo.chatSettings
default: return nil
}
}

View file

@ -3343,9 +3343,6 @@
/* No comment provided by engineer. */
"Your chat profiles" = "Vaše chat profily";
/* No comment provided by engineer. */
"Your chats" = "Vaše konverzace";
/* No comment provided by engineer. */
"Your contact needs to be online for the connection to complete.\nYou can cancel this connection and remove the contact (and try later with a new link)." = "K dokončení připojení, musí být váš kontakt online.\nToto připojení můžete zrušit a kontakt odebrat (a zkusit to později s novým odkazem).";

View file

@ -3343,9 +3343,6 @@
/* No comment provided by engineer. */
"Your chat profiles" = "Meine Chat-Profile";
/* No comment provided by engineer. */
"Your chats" = "Meine Chats";
/* No comment provided by engineer. */
"Your contact needs to be online for the connection to complete.\nYou can cancel this connection and remove the contact (and try later with a new link)." = "Damit die Verbindung hergestellt werden kann, muss Ihr Kontakt online sein.\nSie können diese Verbindung abbrechen und den Kontakt entfernen (und es später nochmals mit einem neuen Link versuchen).";

View file

@ -3343,9 +3343,6 @@
/* No comment provided by engineer. */
"Your chat profiles" = "Mis perfiles";
/* No comment provided by engineer. */
"Your chats" = "Mis chats";
/* No comment provided by engineer. */
"Your contact needs to be online for the connection to complete.\nYou can cancel this connection and remove the contact (and try later with a new link)." = "Tu contacto debe estar en línea para que se complete la conexión.\nPuedes cancelar esta conexión y eliminar el contacto (e intentarlo más tarde con un enlace nuevo).";

View file

@ -3343,9 +3343,6 @@
/* No comment provided by engineer. */
"Your chat profiles" = "Vos profils de chat";
/* No comment provided by engineer. */
"Your chats" = "Vos chats";
/* No comment provided by engineer. */
"Your contact needs to be online for the connection to complete.\nYou can cancel this connection and remove the contact (and try later with a new link)." = "Votre contact a besoin d'être en ligne pour completer la connexion.\nVous pouvez annuler la connexion et supprimer le contact (et réessayer plus tard avec un autre lien).";

View file

@ -3340,9 +3340,6 @@
/* No comment provided by engineer. */
"Your chat profiles" = "I tuoi profili di chat";
/* No comment provided by engineer. */
"Your chats" = "Le tue chat";
/* No comment provided by engineer. */
"Your contact needs to be online for the connection to complete.\nYou can cancel this connection and remove the contact (and try later with a new link)." = "Il tuo contatto deve essere in linea per completare la connessione.\nPuoi annullare questa connessione e rimuovere il contatto (e riprovare più tardi con un link nuovo).";

View file

@ -3334,9 +3334,6 @@
/* No comment provided by engineer. */
"Your chat profiles" = "あなたのチャットプロフィール";
/* No comment provided by engineer. */
"Your chats" = "あなたのチャット";
/* No comment provided by engineer. */
"Your contact needs to be online for the connection to complete.\nYou can cancel this connection and remove the contact (and try later with a new link)." = "接続を完了するには、連絡相手がオンラインになる必要があります。\nこの接続をキャンセルして、連絡先を削除をすることもできます (後でやり直すこともできます)。";

View file

@ -3343,9 +3343,6 @@
/* No comment provided by engineer. */
"Your chat profiles" = "Uw chat profielen";
/* No comment provided by engineer. */
"Your chats" = "Jouw gesprekken";
/* No comment provided by engineer. */
"Your contact needs to be online for the connection to complete.\nYou can cancel this connection and remove the contact (and try later with a new link)." = "Uw contactpersoon moet online zijn om de verbinding te voltooien.\nU kunt deze verbinding verbreken en het contact verwijderen (en later proberen met een nieuwe link).";

View file

@ -3343,9 +3343,6 @@
/* No comment provided by engineer. */
"Your chat profiles" = "Twoje profile czatu";
/* No comment provided by engineer. */
"Your chats" = "Twoje czaty";
/* No comment provided by engineer. */
"Your contact needs to be online for the connection to complete.\nYou can cancel this connection and remove the contact (and try later with a new link)." = "Twój kontakt musi być online, aby połączenie zostało zakończone.\nMożesz anulować to połączenie i usunąć kontakt (i spróbować później z nowym linkiem).";

View file

@ -3340,9 +3340,6 @@
/* No comment provided by engineer. */
"Your chat profiles" = "Ваши профили чата";
/* No comment provided by engineer. */
"Your chats" = "Ваши чаты";
/* No comment provided by engineer. */
"Your contact needs to be online for the connection to complete.\nYou can cancel this connection and remove the contact (and try later with a new link)." = "Ваш контакт должен быть в сети чтобы установить соединение.\nВы можете отменить соединение и удалить контакт (и попробовать позже с другой ссылкой).";

View file

@ -3343,9 +3343,6 @@
/* No comment provided by engineer. */
"Your chat profiles" = "您的聊天资料";
/* No comment provided by engineer. */
"Your chats" = "您的聊天";
/* No comment provided by engineer. */
"Your contact needs to be online for the connection to complete.\nYou can cancel this connection and remove the contact (and try later with a new link)." = "您的联系人需要在线才能完成连接。\n您可以取消此连接并删除联系人然后尝试使用新链接。";