Skip to content

SES-763 Contact block and delete functionality #994

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

Merged
merged 36 commits into from
Apr 8, 2025

Conversation

AL-Session
Copy link
Contributor

@AL-Session AL-Session commented Feb 28, 2025

Adds the ability to long-press on a contact and choose to either block or delete them via a pop-up menu.

To access the functionality hit the search button in the top-right of the home activity then long press on a contact.

Known Issues:
i.) The pop-up menu does not have correctly rounded corners,
ii.) The pop-up menu top-left is not aligned to the centre of the contact-being-deleted's profile image as per the figma design.
I have tried many, many different ways of doing these seemingly-simple things, but to no avail. As such I leave this fine-tuning to a higher power.

@AL-Session AL-Session marked this pull request as ready for review February 28, 2025 02:25
@AL-Session AL-Session marked this pull request as draft March 2, 2025 21:11
@AL-Session
Copy link
Contributor Author

Found an issue where deleted contacts do not have to go through the message request procedure when messaging a recipient who has deleted them - working on it.

long threadId = getThreadIdIfExistsFor(address);
DatabaseComponent.get(context).sessionContactDatabase().deleteContact(address);
DatabaseComponent.get(context).recipientDatabase().deleteRecipient(address);
DatabaseComponent.get(context).threadDatabase().deleteThread(threadId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

You are already in the threadDatabase so you don't need to fetch it all form the DatabaseComponent.
Furthermore there is already a deleteConversation which seems to do a lot more than deleting the thread. Isn't it what you want to call instead?

@SessionHero01
Copy link
Collaborator

Also need to consider removing the entry from the config system - our source of truth of user data.

@ThomasSession ThomasSession marked this pull request as ready for review April 2, 2025 04:02
Comment on lines 22 to 25
private val accountId: String,
private val contactName: String,
private val blockContact: (String) -> Unit,
private val deleteContact: (String) -> Unit,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you have to do empty constructor for a fragment and pass all parameters through arguments, and all callback with the fragment callback pattern, otherwise it won't survive the backstack

ThomasSession and others added 5 commits April 8, 2025 04:01
…ntactsToInviteToGroupActivity.kt

Co-authored-by: SessionHero01 <180888785+SessionHero01@users.noreply.github.com>
…l.kt

Co-authored-by: SessionHero01 <180888785+SessionHero01@users.noreply.github.com>
@ThomasSession ThomasSession merged commit 49c7f18 into dev Apr 8, 2025
4 checks passed
@ThomasSession ThomasSession deleted the fix/SES763_contact_block_and_delete_functionality branch April 8, 2025 04:13
@SessionHero01 SessionHero01 mentioned this pull request Apr 29, 2025
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.

4 participants