diff --git a/src/app/chat/view.nim b/src/app/chat/view.nim index eb4c4541f1..0c2f9506eb 100644 --- a/src/app/chat/view.nim +++ b/src/app/chat/view.nim @@ -513,15 +513,6 @@ QtObject: proc renameGroup*(self: ChatsView, newName: string) {.slot.} = self.status.chat.renameGroup(self.activeChannel.id, newName) - proc blockContact*(self: ChatsView, id: string): string {.slot.} = - return self.status.contacts.blockContact(id) - - proc addContact*(self: ChatsView, id: string): string {.slot.} = - return self.status.contacts.addContact(id) - - proc removeContact*(self: ChatsView, id: string) {.slot.} = - self.status.contacts.removeContact(id) - proc createGroup*(self: ChatsView, groupName: string, pubKeys: string) {.slot.} = let pubKeysSeq = map(parseJson(pubKeys).getElems(), proc(x:JsonNode):string = x.getStr) self.status.chat.createGroup(groupName, pubKeysSeq) diff --git a/src/app/profile/view.nim b/src/app/profile/view.nim index 2f929d9893..c7144e495e 100644 --- a/src/app/profile/view.nim +++ b/src/app/profile/view.nim @@ -276,9 +276,9 @@ QtObject: ensVerified: false ) self.contactToAddChanged() - - proc addContact*(self: ProfileView, pk: string) {.slot.} = - discard self.status.contacts.addContact(pk) + + proc addContact*(self: ProfileView, pk: string): string {.slot.} = + return self.status.contacts.addContact(pk) proc changeContactNickname*(self: ProfileView, publicKey: string, nickname: string) {.slot.} = discard self.status.contacts.addContact(publicKey, nickname) @@ -286,8 +286,8 @@ QtObject: proc unblockContact*(self: ProfileView, id: string) {.slot.} = discard self.status.contacts.unblockContact(id) - proc blockContact*(self: ProfileView, id: string) {.slot.} = - discard self.status.contacts.blockContact(id) + proc blockContact*(self: ProfileView, id: string): string {.slot.} = + return self.status.contacts.blockContact(id) proc removeContact*(self: ProfileView, id: string) {.slot.} = self.status.contacts.removeContact(id) diff --git a/ui/app/AppLayouts/Chat/ChatColumn.qml b/ui/app/AppLayouts/Chat/ChatColumn.qml index 269c7d225c..f8a99c5174 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn.qml @@ -140,7 +140,7 @@ StackLayout { BlockContactConfirmationDialog { id: blockContactConfirmationDialog onBlockButtonClicked: { - chatsModel.blockContact(blockContactConfirmationDialog.contactAddress) + profileModel.blockContact(blockContactConfirmationDialog.contactAddress) blockContactConfirmationDialog.close() profilePopup.close() } diff --git a/ui/app/AppLayouts/Chat/components/ProfilePopup.qml b/ui/app/AppLayouts/Chat/components/ProfilePopup.qml index ea5d816a11..3e249f8a4e 100644 --- a/ui/app/AppLayouts/Chat/components/ProfilePopup.qml +++ b/ui/app/AppLayouts/Chat/components/ProfilePopup.qml @@ -356,7 +356,7 @@ ModalPopup { if (profileModel.isAdded(fromAuthor)) { popup.removeButtonClicked(fromAuthor) } else { - chatsModel.addContact(fromAuthor) + profileModel.addContact(fromAuthor) } profilePopup.close() }