diff --git a/src/app/modules/main/chat_section/chat_content/controller.nim b/src/app/modules/main/chat_section/chat_content/controller.nim index a8cae3573b..2c3f110f5f 100644 --- a/src/app/modules/main/chat_section/chat_content/controller.nim +++ b/src/app/modules/main/chat_section/chat_content/controller.nim @@ -124,6 +124,12 @@ proc init*(self: Controller) = return self.delegate.onChatRenamed(args.newName) + self.events.on(SIGNAL_CHAT_UPDATE) do(e: Args): + var args = ChatUpdateArgsNew(e) + for chat in args.chats: + if self.chatId == chat.id: + self.delegate.onChatEdited(chat) + proc getMyChatId*(self: Controller): string = return self.chatId diff --git a/src/app/modules/main/chat_section/chat_content/module.nim b/src/app/modules/main/chat_section/chat_content/module.nim index 31a3c6bd9d..b39ad1b0e4 100644 --- a/src/app/modules/main/chat_section/chat_content/module.nim +++ b/src/app/modules/main/chat_section/chat_content/module.nim @@ -330,3 +330,4 @@ method onChatEdited*(self: Module, chatDto: ChatDto) = method onChatRenamed*(self: Module, newName: string) = self.view.updateChatDetailsName(newName) + self.messagesModule.updateChatIdentifier() diff --git a/src/app/modules/main/chat_section/module.nim b/src/app/modules/main/chat_section/module.nim index ba0e4ceee9..a7d617ad35 100644 --- a/src/app/modules/main/chat_section/module.nim +++ b/src/app/modules/main/chat_section/module.nim @@ -788,6 +788,7 @@ method addChatIfDontExist*(self: Module, return if self.doesCatOrChatExist(chat.id): + self.onChatRenamed(chat.id, chat.name) return self.addNewChat(chat, belongsToCommunity, events, settingsService, contactService, chatService, diff --git a/src/app_service/service/chat/service.nim b/src/app_service/service/chat/service.nim index e29b4f85c4..4d9c19c32e 100644 --- a/src/app_service/service/chat/service.nim +++ b/src/app_service/service/chat/service.nim @@ -447,6 +447,10 @@ QtObject: error "error while renaming group chat", msg return + var chat = self.chats[chatID] + chat.name = name + self.updateOrAddChat(chat) + self.events.emit(SIGNAL_CHAT_RENAMED, ChatRenameArgs(id: chatId, newName: name)) except Exception as e: error "error while renaming group chat: ", msg = e.msg