mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-14 16:47:25 +00:00
fix(group-chat): fix changing group chat name
This commit is contained in:
parent
c58a656a52
commit
ddbe4e236d
@ -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
|
||||
|
||||
|
@ -330,3 +330,4 @@ method onChatEdited*(self: Module, chatDto: ChatDto) =
|
||||
|
||||
method onChatRenamed*(self: Module, newName: string) =
|
||||
self.view.updateChatDetailsName(newName)
|
||||
self.messagesModule.updateChatIdentifier()
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user