parent
a306d3a9d7
commit
219d7b46c0
|
@ -119,6 +119,12 @@ method init*(self: Controller) =
|
||||||
return
|
return
|
||||||
self.delegate.onChatEdited(args.chat)
|
self.delegate.onChatEdited(args.chat)
|
||||||
|
|
||||||
|
self.events.on(SIGNAL_CHAT_RENAMED) do(e: Args):
|
||||||
|
var args = ChatRenameArgs(e)
|
||||||
|
if(self.chatId != args.id):
|
||||||
|
return
|
||||||
|
self.delegate.onChatRenamed(args.newName)
|
||||||
|
|
||||||
method getMyChatId*(self: Controller): string =
|
method getMyChatId*(self: Controller): string =
|
||||||
return self.chatId
|
return self.chatId
|
||||||
|
|
||||||
|
|
|
@ -293,3 +293,6 @@ method onNotificationsUpdated*(self: Module, hasUnreadMessages: bool, notificati
|
||||||
method onChatEdited*(self: Module, chatDto: ChatDto) =
|
method onChatEdited*(self: Module, chatDto: ChatDto) =
|
||||||
self.view.updateChatDetails(chatDto.name, chatDto.description)
|
self.view.updateChatDetails(chatDto.name, chatDto.description)
|
||||||
self.messagesModule.updateChatIdentifier()
|
self.messagesModule.updateChatIdentifier()
|
||||||
|
|
||||||
|
method onChatRenamed*(self: Module, newName: string) =
|
||||||
|
self.view.updateChatDetailsName(newName)
|
||||||
|
|
|
@ -31,3 +31,6 @@ method onContactDetailsUpdated*(self: AccessInterface, contactId: string) {.base
|
||||||
|
|
||||||
method onChatEdited*(self: AccessInterface, chatDto: ChatDto) {.base.} =
|
method onChatEdited*(self: AccessInterface, chatDto: ChatDto) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method onChatRenamed*(self: AccessInterface, newName: string) {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -118,3 +118,7 @@ QtObject:
|
||||||
self.chatDetails.setName(name)
|
self.chatDetails.setName(name)
|
||||||
self.chatDetails.setDescription(description)
|
self.chatDetails.setDescription(description)
|
||||||
self.chatDetailsChanged()
|
self.chatDetailsChanged()
|
||||||
|
|
||||||
|
proc updateChatDetailsName*(self: View, name: string) =
|
||||||
|
self.chatDetails.setName(name)
|
||||||
|
self.chatDetailsChanged()
|
||||||
|
|
|
@ -391,7 +391,11 @@ QtObject:
|
||||||
method renameGroupChat*(self: Service, chatId: string, newName: string) =
|
method renameGroupChat*(self: Service, chatId: string, newName: string) =
|
||||||
try:
|
try:
|
||||||
let response = status_chat.renameGroupChat(chatId, newName)
|
let response = status_chat.renameGroupChat(chatId, newName)
|
||||||
if (response.error.isNil):
|
if (not response.error.isNil):
|
||||||
|
let msg = response.error.message & " chatId=" & chatId
|
||||||
|
error "error while renaming group chat", msg
|
||||||
|
return
|
||||||
|
|
||||||
self.events.emit(SIGNAL_CHAT_RENAMED, ChatRenameArgs(id: chatId, newName: newName))
|
self.events.emit(SIGNAL_CHAT_RENAMED, ChatRenameArgs(id: chatId, newName: newName))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error "error while renaming group chat: ", msg = e.msg
|
error "error while renaming group chat: ", msg = e.msg
|
||||||
|
|
Loading…
Reference in New Issue