refactor: remove duplicated methods in chatModel and use profileModel
This commit is contained in:
parent
0c0baf29e8
commit
fd93650b23
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -140,7 +140,7 @@ StackLayout {
|
|||
BlockContactConfirmationDialog {
|
||||
id: blockContactConfirmationDialog
|
||||
onBlockButtonClicked: {
|
||||
chatsModel.blockContact(blockContactConfirmationDialog.contactAddress)
|
||||
profileModel.blockContact(blockContactConfirmationDialog.contactAddress)
|
||||
blockContactConfirmationDialog.close()
|
||||
profilePopup.close()
|
||||
}
|
||||
|
|
|
@ -356,7 +356,7 @@ ModalPopup {
|
|||
if (profileModel.isAdded(fromAuthor)) {
|
||||
popup.removeButtonClicked(fromAuthor)
|
||||
} else {
|
||||
chatsModel.addContact(fromAuthor)
|
||||
profileModel.addContact(fromAuthor)
|
||||
}
|
||||
profilePopup.close()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue