adapt code

This commit is contained in:
Avently 2024-08-01 17:22:21 +09:00
parent acba0b4a7d
commit 56b9d73234
3 changed files with 7 additions and 7 deletions

View file

@ -793,9 +793,9 @@ suspend fun save(applyToMode: DefaultThemeMode?, newTheme: ThemeModeOverride?, c
private fun setContactAlias(chat: Chat, localAlias: String, chatModel: ChatModel) = withBGApi {
val chatRh = chat.remoteHostId
chatModel.controller.apiSetContactAlias(chatRh, chat.chatInfo.apiId, localAlias)?.let {
chatModel.controller.apiSetContactAlias(chatRh, chat.chatInfo.apiId, localAlias)?.let { contact ->
withChats {
updateContact(chatRh, it)
updateContact(chatRh, contact)
}
}
}

View file

@ -69,12 +69,12 @@ fun GroupMemberInfoView(
developerTools,
connectionCode,
getContactChat = { chatModel.getContactChat(it) },
openDirectChat = {
openDirectChat = { contactId ->
withBGApi {
val c = chatModel.controller.apiGetChat(rhId, ChatType.Direct, it)
val c = chatModel.controller.apiGetChat(rhId, ChatType.Direct, contactId)
if (c != null) {
withChats {
if (chatModel.getContactChat(it) == null) {
if (chatModel.getContactChat(contactId) == null) {
addChat(c)
}
chatModel.chatItemStatuses.clear()

View file

@ -186,9 +186,9 @@ fun DeleteButton(onClick: () -> Unit) {
}
private fun setContactAlias(rhId: Long?, contactConnection: PendingContactConnection, localAlias: String, chatModel: ChatModel) = withBGApi {
chatModel.controller.apiSetConnectionAlias(rhId, contactConnection.pccConnId, localAlias)?.let {
chatModel.controller.apiSetConnectionAlias(rhId, contactConnection.pccConnId, localAlias)?.let { connection ->
withChats {
updateContactConnection(rhId, it)
updateContactConnection(rhId, connection)
}
}
}