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

Allow the user to control whether messages from blocked users are filtered from open groups. #2395

Open
wants to merge 4 commits into
base: clearnet
Choose a base branch
from

Conversation

ianmacd
Copy link

@ianmacd ianmacd commented Jul 26, 2022

Contributor checklist:

Description

Currently, the messages of blocked users are discarded at fetch time from open groups. This can seriously disturb the flow of open groups in which a blocked user is a frequent contributor, and the user has no control over this behaviour. His only recourse if to unblock such users.

This patch makes it possible to turn off the open group filtration of messages from blocked users. It also defers the point of filtration until display time, making it non-destructive. Filtration of previously received messages can thus be undone at any time by simply disabling the feature in Settings.

Finally, I noticed that messages from blocked users were not being filtered from private conversations and closed groups. Blocked conversations were also not indicated as such in search results. This patch also fixes those problems.

image

Instead, defer filtering until the display stage. This has the advantage
that no messages are actually discarded, allowing filtering to be undone
by simply disabling it in Settings.
If a conversation with a blocked user is returned, indicate it as such.
@KeeJef
Copy link
Collaborator

KeeJef commented Jul 26, 2022

Sounds good, can you clarify

Finally, I noticed that messages from blocked users were not being filtered from private conversations and closed groups

Do you mean that with this patch Session will not show messages from blocked users in 1-1s and Closed groups?

Blocked conversations were also not indicated as such in search results. This patch also fixes those problems.

How is this indicated visually?

@ianmacd
Copy link
Author

ianmacd commented Jul 26, 2022

Do you mean that with this patch Session will not show messages from blocked users in 1-1s and Closed groups?

Yes, but regardless of the toggle setting. That's inconsistent behaviour, though, so perhaps the toggle should govern all convos, not just open groups. Thoughts?

In 1-1s, you will see only your own side of the conversation. I know that's not terribly useful, but the reason I didn't treat it specially because I think most users actually delete the convos that they block.

Closed groups use the same code, so blocked users will be filtered from those also.

Blocked conversations were also not indicated as such in search results. This patch also fixes those problems.

How is this indicated visually?

It just triggers the same code that you apply elsewhere to blocked convos, which essentially just seems to place a vertical red bar down the left border:

image

(I had to block you to illustrate the concept. 😀)

@KeeJef
Copy link
Collaborator

KeeJef commented Jul 28, 2022

I think we should show messages from the offending party before their blocking in all conversations, after being blocked, in 1-1s and closed groups we shouldn't show future messages from the blocked individual. But we should allow the user to see messages from blocked users in open groups (with a toggle switch)

@ianmacd
Copy link
Author

ianmacd commented Jul 28, 2022

I think we should show messages from the offending party before their blocking in all conversations,

That's kind of tricky, because the block is not currently timestamped, so we don't know when it went into effect. All we know is that a user is blocked or not, but not since when.

after being blocked, in 1-1s and closed groups we shouldn't show future messages from the blocked individual. But we should allow the user to see messages from blocked users in open groups (with a toggle switch)

OK, so that's the behaviour I've implemented. Blocked users have their messages removed from 1-to-1s and from closed groups, regardless of the toggle. The toggle is used only for open groups, to allow the user to override the block and see the messages of blocked users there.

I think a database change would be required in order to make decisions based on when a block was last added or removed; or maybe it's possible to pull the timestamp of the last row update. I don't know about that, but it's not surfaced in the code at present, at least.

@KeeJef
Copy link
Collaborator

KeeJef commented Mar 27, 2024

Due to the adoption of ID blinding in communities, this PR is now rendered non-functional. The current default behavior, as a result of ID blinding, is that when a user is blocked, their messages remain visible within communities. This is because the block action targets the actual Session ID, not the blinded ID that is used within the group. To address this issue, the PR needs to be restructured to associate a user's Session ID with their blinded ID, thereby enabling the blocking of messages from that blinded ID in communities.

Ideally, the default behavior should ensure that once a user is blocked, their messages become invisible in communities, 1-1s and closed groups. But the PR should add an opt-in toggle allowing users to choose to see messages from blocked individuals in communities again. Implementing this feature will necessitate modifications to the current PR.

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.

None yet

2 participants