Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(contacts): remove isContact, use isMutualContact or isAdded indead #6375

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

jrainville
Copy link
Member

Fixes #6220

Fixes the issue with the mutual contact icon showing when just added.
It also does a huge cleanup of the codebase to remove isContact and replace it with either isAdded, when we care only about if we added, or isMutualContact if we want the contact to be mutual
Also fixes an issue with the MessageContextMenu not reflecting the added state correctly.

Asking for QA testing on this one, since it touches contacts all over the app. I made sure to double check my changes to make sure to use isAdded and isMutualContact appropriately, but the reason why I did this change is because isContact was used in both contexts, so it was confusing.
Anyway, all that to say, make sure the contact list, states and other interactions still work as expected.

Copy link
Contributor

@osmaczko osmaczko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing that 👍

Please change all occurrences of isMutualContact back to isContact (democracy here :D)

@@ -32,7 +32,7 @@ type
colorId: int
colorHash: string
onlineStatus: OnlineStatus
isContact: bool
isMutualContact: bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
isMutualContact: bool
isContact: bool

@@ -12,7 +12,7 @@ type
ColorId
ColorHash
OnlineStatus
IsContact
IsMutualContact
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IsMutualContact
IsContact

@@ -12,7 +12,7 @@ Item {
width: parent.width
height: childrenRect.height

property bool isContact
property bool isContactAdded
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
property bool isContactAdded
property bool isUserAdded

@@ -55,7 +55,7 @@ Item {
property Timer timer: Timer { }
property var userList
property var contactDetails: Utils.getContactDetailsAsJson(root.activeChatId)
property bool isContact: root.contactDetails.isContact
property bool isContactAdded: root.contactDetails.isAdded
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
property bool isContactAdded: root.contactDetails.isAdded
property bool isUserAdded: root.userDetails.isAdded

@@ -177,7 +177,7 @@ StatusAppThreePanelLayout {
confirmationText: qsTr("Are you sure you want to remove this contact?")
onConfirmButtonClicked: {
let pk = chatColumn.contactToRemove
if (Utils.getContactDetailsAsJson(pk).isContact) {
if (Utils.getContactDetailsAsJson(pk).isAdded) {
Copy link
Contributor

@osmaczko osmaczko Jul 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(not required)

Suggested change
if (Utils.getContactDetailsAsJson(pk).isAdded) {
if (Utils.getUserDetailsAsJson(pk).isAdded) {

we should probably create a separate task to fix status-desktup codebase naming in regards to contact vs user

@jrainville
Copy link
Member Author

@osmaczko updated. getContactDetailsAsJson and contactDetails will be updated in another PR. The number of changes here is already pretty high..

@status-im-auto
Copy link
Member

status-im-auto commented Jul 7, 2022

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
⁉️ bb4fc3e #3 2022-07-07 14:29:58 ~2 min linux-cpp 📄log
✔️ bb4fc3e #3 2022-07-07 14:35:32 ~8 min macos 📦dmg
✔️ bb4fc3e #3 2022-07-07 14:40:18 ~12 min linux 📦tgz
✔️ bb4fc3e #3 2022-07-07 14:57:09 ~29 min windows 📦exe
✔️ 715ea1c #4 2022-07-11 13:43:46 ~9 min macos 📦dmg
✔️ 715ea1c #4 2022-07-11 13:44:54 ~10 min linux 📦tgz
✔️ 715ea1c #4 2022-07-11 13:58:18 ~23 min windows 📦exe

@osmaczko
Copy link
Contributor

osmaczko commented Jul 8, 2022

@osmaczko updated.

Great, thank you.

getContactDetailsAsJson and contactDetails will be updated in another PR. The number of changes here is already pretty high..

Of course, I haven't expected anything else! -> "we should probably create a separate task to fix status-desktup codebase naming in regards to contact vs user"

@elina2015 elina2015 requested review from elina2015 and removed request for Hbouaz July 8, 2022 18:45
Fixes #6220

Fixes the issue with the mutual contact icon showing when just added.
It also does a huge cleanup of the codebase to remove isContact and replace it with either isAdded, when we care only about if we added, or isMutualContact if we want the contact to be mutual
Also fixes an issue with the MessageContextMenu not reflecting the added state correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sending a contact request immediatly adds mutual contact icon to their profile in the memberlist
5 participants