fix: make contact related APIs working again
This adjust the changes needed to have Status Desktop talk to new contact related APIs that were introduced in status-lib and status-go as of https://github.com/status-im/status-lib/pull/110 Closes #4147
This commit is contained in:
parent
de64254463
commit
71d2ab25c0
|
@ -123,49 +123,23 @@ QtObject:
|
||||||
# self.events.emit("contactUpdate", ContactUpdateArgs(contacts: @[profile]))
|
# self.events.emit("contactUpdate", ContactUpdateArgs(contacts: @[profile]))
|
||||||
|
|
||||||
proc rejectContactRequest*(self: Service, publicKey: string) =
|
proc rejectContactRequest*(self: Service, publicKey: string) =
|
||||||
let contact = self.getContact(publicKey)
|
status_contacts.rejectContactRequest(publicKey)
|
||||||
contact.hasAddedUs = false
|
|
||||||
|
|
||||||
self.saveContact(contact)
|
|
||||||
self.events.emit("contactRemoved", Args())
|
self.events.emit("contactRemoved", Args())
|
||||||
# status_contacts.rejectContactRequest(publicKey)
|
|
||||||
|
|
||||||
proc changeContactNickname*(self: Service, accountKeyUID: string, publicKey: string, nicknameToSet: string) =
|
proc changeContactNickname*(self: Service, accountKeyUID: string, publicKey: string, nicknameToSet: string) =
|
||||||
# status_contacts.setNickName(publicKey, nicknameToSet, accountKeyUID)
|
status_contacts.setContactLocalNickname(publicKey, nicknameToSet)
|
||||||
var contact = self.getOrCreateContact(publicKey)
|
|
||||||
# let nickname =
|
|
||||||
# if (nicknameToSet == ""):
|
|
||||||
# contact.localNickname
|
|
||||||
# elif (nicknameToSet == DELETE_CONTACT):
|
|
||||||
# ""
|
|
||||||
# else:
|
|
||||||
# nicknameToSet
|
|
||||||
|
|
||||||
# contact.localNickname = nickname
|
|
||||||
self.saveContact(contact)
|
|
||||||
self.events.emit("contactAdded", Args())
|
self.events.emit("contactAdded", Args())
|
||||||
# sendContactUpdate(contact.id, accountKeyUID)
|
|
||||||
|
|
||||||
proc unblockContact*(self: Service, publicKey: string) =
|
proc unblockContact*(self: Service, publicKey: string) =
|
||||||
# status_contacts.unblockContact(publicKey)
|
status_contacts.unblockContact(publicKey)
|
||||||
var contact = self.getContact(publicKey)
|
|
||||||
contact.blocked = false
|
|
||||||
self.saveContact(contact)
|
|
||||||
self.events.emit("contactUnblocked", old_status_contacts.ContactIdArgs(id: publicKey))
|
self.events.emit("contactUnblocked", old_status_contacts.ContactIdArgs(id: publicKey))
|
||||||
|
|
||||||
proc blockContact*(self: Service, publicKey: string) =
|
proc blockContact*(self: Service, publicKey: string) =
|
||||||
var contact = self.getContact(publicKey)
|
status_contacts.blockContact(publicKey)
|
||||||
contact.blocked = true
|
|
||||||
self.saveContact(contact)
|
|
||||||
self.events.emit("contactBlocked", old_status_contacts.ContactIdArgs(id: publicKey))
|
self.events.emit("contactBlocked", old_status_contacts.ContactIdArgs(id: publicKey))
|
||||||
|
|
||||||
proc removeContact*(self: Service, publicKey: string) =
|
proc removeContact*(self: Service, publicKey: string) =
|
||||||
# status_contacts.removeContact(publicKey)
|
status_contacts.removeContact(publicKey)
|
||||||
var contact = self.getContact(publicKey)
|
|
||||||
contact.added = false
|
|
||||||
contact.hasAddedUs = false
|
|
||||||
|
|
||||||
self.saveContact(contact)
|
|
||||||
self.events.emit("contactRemoved", Args())
|
self.events.emit("contactRemoved", Args())
|
||||||
# let channelId = status_utils.getTimelineChatId(publicKey)
|
# let channelId = status_utils.getTimelineChatId(publicKey)
|
||||||
# if status_chat.hasChannel(channelId):
|
# if status_chat.hasChannel(channelId):
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6c7deb85a0f0e600a3875adac751bfc4625e7346
|
Subproject commit 4ff2b6857c6af35da2337d729dc2ddf54c2e2c9c
|
Loading…
Reference in New Issue