core: allow to delete contacts that are in groups; group contacts management rfc (#1229)

This commit is contained in:
JRoberts
2022-10-20 19:27:00 +04:00
committed by GitHub
parent c4fc8a97b1
commit 98cb1c39f2
13 changed files with 244 additions and 83 deletions
+4 -12
View File
@@ -426,18 +426,10 @@ func deleteChat(_ chat: Chat) async {
DispatchQueue.main.async { ChatModel.shared.removeChat(cInfo.id) }
} catch let error {
logger.error("deleteChat apiDeleteChat error: \(responseError(error))")
switch error as? ChatResponse {
case let .chatCmdError(.error(.contactGroups(contact, groupNames))):
AlertManager.shared.showAlertMsg(
title: "Can't delete contact!",
message: "Contact \(contact.displayName) cannot be deleted, they are a member of the group(s) \(groupNames.joined(separator: ", "))."
)
default:
AlertManager.shared.showAlertMsg(
title: "Error deleting chat!",
message: "Error: \(responseError(error))"
)
}
AlertManager.shared.showAlertMsg(
title: "Error deleting chat!",
message: "Error: \(responseError(error))"
)
}
}