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

Prevent silenced local users from notifying remote users not following them #10575

Merged

Conversation

ClearlyClaire
Copy link
Contributor

This is an attempt to extend the local restrictions of silenced users to the
federation.

@ClearlyClaire ClearlyClaire force-pushed the fixes/silent-users-activitypub-mentions branch from 4f209f1 to 4f8623d Compare April 14, 2019 10:06
@ClearlyClaire ClearlyClaire force-pushed the fixes/silent-users-activitypub-mentions branch from fe7a713 to 45fe442 Compare April 14, 2019 11:21
@ClearlyClaire
Copy link
Contributor Author

When a silenced local users, mentionned users that do not follow (or request to follow) them won't appear in the to and cc fields, but messages will still get delivered to mentioned user's inbox.
While other implementations may interpret this differently, this should allow mentioned users of existing Mastodon instances to be able to see the toots if they look for them while preventing them from appearing in the recipient's notifications.

@ClearlyClaire ClearlyClaire marked this pull request as ready for review April 14, 2019 11:22
@ClearlyClaire
Copy link
Contributor Author

I haven't actually tested it yet.
Also, I'm not super happy with the audience of a toot possibly changing over time when users get silenced/unsilenced, but that shouldn't be a problem in practice, and the same could be said of remote mentioned users disappearing or getting banned I guess

# Only notify followers if the account is locally silenced
account_ids = status.active_mentions.pluck(:account_id)
cc.concat(status.account.followers.where(id: account_ids).map { |account| uri_for(account) })
cc.concat(FollowRequest.where(target_account_id: status.account_id, account_id: account_ids).map { |request| uri_for(request.account) })
Copy link
Member

Choose a reason for hiding this comment

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

what's up with this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what you mean. It's to allow silenced local users to mention (and notify) remote users who have requested to follow them.
This is the same logic as in NotifyService for local notifications.

@Gargron Gargron merged commit 62f5235 into mastodon:master May 9, 2019
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
…g them (mastodon#10575)

* Prevent silenced local users from notifying remote users not following them

This is an attempt to extend the local restrictions of silenced users to the
federation.

* Add tests

* Add tests for making sure private status don't get sent over OStatus
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
…g them (mastodon#10575)

* Prevent silenced local users from notifying remote users not following them

This is an attempt to extend the local restrictions of silenced users to the
federation.

* Add tests

* Add tests for making sure private status don't get sent over OStatus
messenjahofchrist pushed a commit to Origin-Creative/mastodon that referenced this pull request Jul 30, 2021
…g them (mastodon#10575)

* Prevent silenced local users from notifying remote users not following them

This is an attempt to extend the local restrictions of silenced users to the
federation.

* Add tests

* Add tests for making sure private status don't get sent over OStatus
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.

3 participants