refactor: contacts-perfomance
This commit is contained in:
parent
a189b0d72b
commit
0fd3182899
|
@ -138,7 +138,8 @@ QtObject:
|
|||
c.ensName = contact.ensName
|
||||
c.ensVerified = contact.ensVerified
|
||||
c.identityImage = contact.identityImage
|
||||
c.systemTags = contact.systemTags
|
||||
c.added = contact.added
|
||||
c.blocked = contact.blocked
|
||||
|
||||
if not found:
|
||||
self.addContactToList(contact)
|
||||
|
|
|
@ -82,13 +82,13 @@ QtObject:
|
|||
break
|
||||
|
||||
self.contactList.updateContact(contact)
|
||||
if contact.systemTags.contains(contactAdded):
|
||||
if contact.added:
|
||||
self.addedContacts.updateContact(contact)
|
||||
|
||||
if contact.isBlocked():
|
||||
self.blockedContacts.updateContact(contact)
|
||||
|
||||
if contact.requestReceived() and not contact.systemTags.contains(contactAdded) and not contact.systemTags.contains(contactBlocked):
|
||||
if contact.requestReceived() and not contact.added and not contact.blocked:
|
||||
self.contactRequests.updateContact(contact)
|
||||
|
||||
if not requestAlreadyAdded and contact.requestReceived():
|
||||
|
@ -101,9 +101,10 @@ QtObject:
|
|||
|
||||
proc setContactList*(self: ContactsView, contactList: seq[Profile]) =
|
||||
self.contactList.setNewData(contactList)
|
||||
self.addedContacts.setNewData(contactList.filter(c => c.systemTags.contains(contactAdded)))
|
||||
self.blockedContacts.setNewData(contactList.filter(c => c.systemTags.contains(contactBlocked)))
|
||||
self.contactRequests.setNewData(contactList.filter(c => c.systemTags.contains(contactRequest) and not c.systemTags.contains(contactAdded) and not c.systemTags.contains(contactBlocked)))
|
||||
self.addedContacts.setNewData(contactList.filter(c => c.added))
|
||||
self.blockedContacts.setNewData(contactList.filter(c => c.blocked))
|
||||
self.contactRequests.setNewData(contactList.filter(c => c.hasAddedUs and not c.added and not c.blocked))
|
||||
|
||||
self.contactListChanged()
|
||||
|
||||
QtProperty[QVariant] list:
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 9f88c1b8b45d8fbcf88dc5fec1e0f255f6e1359f
|
||||
Subproject commit 1ae94006aed9668571ec9a3ee877364786dc47fb
|
Loading…
Reference in New Issue