-
Notifications
You must be signed in to change notification settings - Fork 25
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
SES-763 Contact block and delete functionality #994
Conversation
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. |
app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/thoughtcrime/securesms/home/search/GlobalSearchAdapter.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/thoughtcrime/securesms/database/ThreadDatabase.java
Outdated
Show resolved
Hide resolved
long threadId = getThreadIdIfExistsFor(address); | ||
DatabaseComponent.get(context).sessionContactDatabase().deleteContact(address); | ||
DatabaseComponent.get(context).recipientDatabase().deleteRecipient(address); | ||
DatabaseComponent.get(context).threadDatabase().deleteThread(threadId); |
There was a problem hiding this comment.
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?
app/src/main/java/org/thoughtcrime/securesms/database/ThreadDatabase.java
Outdated
Show resolved
Hide resolved
Also need to consider removing the entry from the config system - our source of truth of user data. |
app/src/main/java/org/thoughtcrime/securesms/database/RecipientDatabase.java
Outdated
Show resolved
Hide resolved
Using coroutine properly
app/src/main/java/org/thoughtcrime/securesms/contacts/SelectContactsToInviteToGroupActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/thoughtcrime/securesms/database/SessionContactDatabase.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/thoughtcrime/securesms/database/ThreadDatabase.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/thoughtcrime/securesms/home/HomeViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/thoughtcrime/securesms/home/HomeViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/thoughtcrime/securesms/home/search/GlobalSearchAdapter.kt
Outdated
Show resolved
Hide resolved
private val accountId: String, | ||
private val contactName: String, | ||
private val blockContact: (String) -> Unit, | ||
private val deleteContact: (String) -> Unit, |
There was a problem hiding this comment.
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
…ntactsToInviteToGroupActivity.kt Co-authored-by: SessionHero01 <180888785+SessionHero01@users.noreply.github.com>
…l.kt Co-authored-by: SessionHero01 <180888785+SessionHero01@users.noreply.github.com>
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.