fix(@desktop/chat): removing contact results in the same contact's contact request showing up again

Fixes: #3418
This commit is contained in:
Sale Djenic 2021-09-21 10:43:44 +02:00 committed by Iuri Matias
parent 2322f501fa
commit f54f3a61bf
3 changed files with 1 additions and 8 deletions

View File

@ -196,12 +196,9 @@ QtObject:
) )
self.contactToAddChanged() self.contactToAddChanged()
proc contactChanged(self: ContactsView, publicKey: string, isAdded: bool) {.signal.}
proc addContact*(self: ContactsView, publicKey: string): string {.slot.} = proc addContact*(self: ContactsView, publicKey: string): string {.slot.} =
result = self.status.contacts.addContact(publicKey, self.accountKeyUID) result = self.status.contacts.addContact(publicKey, self.accountKeyUID)
self.status.chat.join(status_utils.getTimelineChatId(publicKey), ChatType.Profile, "", publicKey) self.status.chat.join(status_utils.getTimelineChatId(publicKey), ChatType.Profile, "", publicKey)
self.contactChanged(publicKey, true)
proc rejectContactRequest*(self: ContactsView, publicKey: string) {.slot.} = proc rejectContactRequest*(self: ContactsView, publicKey: string) {.slot.} =
self.status.contacts.rejectContactRequest(publicKey) self.status.contacts.rejectContactRequest(publicKey)
@ -238,4 +235,3 @@ QtObject:
let channelId = status_utils.getTimelineChatId(publicKey) let channelId = status_utils.getTimelineChatId(publicKey)
if self.status.chat.hasChannel(channelId): if self.status.chat.hasChannel(channelId):
self.status.chat.leave(channelId) self.status.chat.leave(channelId)
self.contactChanged(publicKey, false)

View File

@ -38,7 +38,6 @@ StatusModal {
signal contactUnblocked(publicKey: string) signal contactUnblocked(publicKey: string)
signal contactBlocked(publicKey: string) signal contactBlocked(publicKey: string)
signal contactAdded(publicKey: string) signal contactAdded(publicKey: string)
signal contactRemoved(publicKey: string)
function openPopup(showFooter, userNameParam, fromAuthorParam, identiconParam, textParam, nicknameParam) { function openPopup(showFooter, userNameParam, fromAuthorParam, identiconParam, textParam, nicknameParam) {
userName = userNameParam || "" userName = userNameParam || ""
@ -227,8 +226,6 @@ StatusModal {
} }
removeContactConfirmationDialog.close(); removeContactConfirmationDialog.close();
popup.close(); popup.close();
popup.contactRemoved(fromAuthor);
} }
} }

2
vendor/status-lib vendored

@ -1 +1 @@
Subproject commit 4c1b47dae140bbd35e9b4fda3e7c6ee56aad0c7a Subproject commit cdb06facdd751d1dc69f57f7271ff2796228975f