fix(Contacts): Remove lagecy `removeContactRequestRejection`

Close #9935
This commit is contained in:
MishkaRogachev 2023-04-17 19:37:43 +04:00 committed by Jonathan Rainville
parent c85cead983
commit e160e70121
8 changed files with 3 additions and 60 deletions

View File

@ -41,10 +41,6 @@ proc init*(self: Controller) =
var args = ContactArgs(e)
self.delegate.contactRemoved(args.contactId)
self.events.on(SIGNAL_CONTACT_REJECTION_REMOVED) do(e: Args):
var args = ContactArgs(e)
self.delegate.contactRequestRejectionRemoved(args.contactId)
self.events.on(SIGNAL_CONTACT_NICKNAME_CHANGED) do(e: Args):
var args = ContactArgs(e)
self.delegate.contactNicknameChanged(args.contactId)
@ -127,9 +123,6 @@ proc acceptContactRequest*(self: Controller, publicKey: string, contactRequestId
proc dismissContactRequest*(self: Controller, publicKey: string, contactRequestId: string) =
self.contactsService.dismissContactRequest(publicKey, contactRequestId)
proc removeContactRequestRejection*(self: Controller, publicKey: string) =
self.contactsService.removeContactRequestRejection(publicKey)
proc switchToOrCreateOneToOneChat*(self: Controller, chatId: string) =
self.chatService.switchToOrCreateOneToOneChat(chatId, "")

View File

@ -51,9 +51,6 @@ method blockContact*(self: AccessInterface, publicKey: string) {.base.} =
method removeContact*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method removeContactRequestRejection*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
# Controller Delegate Interface
method contactAdded*(self: AccessInterface, publicKey: string) {.base.} =
@ -110,9 +107,6 @@ method declineVerificationRequest*(self: AccessInterface, publicKey: string): vo
method acceptVerificationRequest*(self: AccessInterface, publicKey: string, response: string): void {.base.} =
raise newException(ValueError, "No implementation available")
method contactRequestRejectionRemoved*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getReceivedVerificationRequests*(self: AccessInterface): seq[VerificationRequest] {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -125,9 +125,6 @@ method removeContact*(self: Module, publicKey: string) =
method changeContactNickname*(self: Module, publicKey: string, nickname: string) =
self.controller.changeContactNickname(publicKey, nickname)
method removeContactRequestRejection*(self: Module, publicKey: string) =
self.controller.removeContactRequestRejection(publicKey)
proc addItemToAppropriateModel(self: Module, item: UserItem) =
if(singletonInstance.userProfile.getPubKey() == item.pubKey):
return

View File

@ -161,9 +161,6 @@ QtObject:
proc removeTrustStatus*(self: View, publicKey: string) {.slot.} =
self.delegate.removeTrustStatus(publicKey)
proc removeContactRequestRejection*(self: View, publicKey: string) {.slot.} =
self.delegate.removeContactRequestRejection(publicKey)
proc getSentVerificationDetailsAsJson(self: View, publicKey: string): string {.slot.} =
return self.delegate.getSentVerificationDetailsAsJson(publicKey)

View File

@ -57,7 +57,6 @@ const SIGNAL_CONTACT_ADDED* = "contactAdded"
const SIGNAL_CONTACT_BLOCKED* = "contactBlocked"
const SIGNAL_CONTACT_UNBLOCKED* = "contactUnblocked"
const SIGNAL_CONTACT_REMOVED* = "contactRemoved"
const SIGNAL_CONTACT_REJECTION_REMOVED* = "contactRejectionRemoved"
const SIGNAL_CONTACT_NICKNAME_CHANGED* = "contactNicknameChanged"
const SIGNAL_CONTACTS_STATUS_UPDATED* = "contactsStatusUpdated"
const SIGNAL_CONTACT_UPDATED* = "contactUpdated"
@ -78,7 +77,7 @@ const SIGNAL_CONTACT_INFO_REQUEST_FINISHED* = "contactInfoRequestFinished"
type
ContactsGroup* {.pure.} = enum
AllKnownContacts
MyMutualContacts
MyMutualContacts
IncomingPendingContactRequests
OutgoingPendingContactRequests
IncomingRejectedContactRequests
@ -474,16 +473,6 @@ QtObject:
except Exception as e:
error "an error occurred while dismissing contact request", msg=e.msg
proc removeContactRequestRejection*(self: Service, publicKey: string) =
var contact = self.getContactById(publicKey)
contact.removed = false
# When we know what flags or what `status-go` end point we need to call, we should add
# that call here.
self.saveContact(contact)
self.events.emit(SIGNAL_CONTACT_REJECTION_REMOVED, ContactArgs(contactId: contact.id))
proc changeContactNickname*(self: Service, publicKey: string, nickname: string) =
var contact = self.getContactById(publicKey)
contact.localNickname = nickname
@ -533,6 +522,7 @@ QtObject:
var contact = self.getContactById(publicKey)
contact.removed = true
contact.added = false
contact.hasAddedUs = false
self.saveContact(contact)
self.events.emit(SIGNAL_CONTACT_REMOVED, ContactArgs(contactId: contact.id))

View File

@ -165,10 +165,6 @@ SplitView {
logs.logEvent("contactsStore::removeTrustStatus", ["publicKey"], arguments)
}
function removeContactRequestRejection(publicKey) {
logs.logEvent("contactsStore::removeContactRequestRejection", ["publicKey"], arguments)
}
function verifiedUntrustworthy(publicKey) {
logs.logEvent("contactsStore::verifiedUntrustworthy", ["publicKey"], arguments)
}

View File

@ -77,10 +77,6 @@ QtObject {
root.contactsModule.dismissContactRequest(pubKey, contactRequestId)
}
function removeContactRequestRejection(pubKey) {
root.contactsModule.removeContactRequestRejection(pubKey)
}
function markUntrustworthy(pubKey) {
root.contactsModule.markUntrustworthy(pubKey)
}

View File

@ -191,22 +191,6 @@ Pane {
}
}
Component {
id: btnRevertContactRequestRejectionComponent
StatusButton {
size: StatusButton.Size.Small
text: qsTr("Reverse Contact Rejection")
icon.name: "refresh"
icon.width: 16
icon.height: 16
onClicked: {
root.contactsStore.removeContactRequestRejection(root.publicKey)
d.reload()
}
}
}
Component {
id: btnSendContactRequestComponent
StatusButton {
@ -384,11 +368,7 @@ Pane {
// contact request, incoming, pending
if (!d.isContact && d.isContactRequestReceived) {
if (d.contactDetails.removed) {
return btnRevertContactRequestRejectionComponent
} else {
return btnAcceptContactRequestComponent
}
return btnAcceptContactRequestComponent
}
// contact request, incoming, rejected