user blocking of domains #501

Closed
wants to merge 8 commits into
from

Conversation

Projects
None yet
5 participants
@deckycoss

deckycoss commented Jan 19, 2017

this is a patch for issue #423. it's still in the early stages as it only implements the AccountDomainBlock model, and filtering out toots by blocked domains from the user's public timeline. the finished patch will update the API and provide an interface for the user to create domain blocks.

this builds off of @hach-que 's unfinished patch #302.

@@ -85,7 +85,7 @@ def unblock
def relationships
ids = params[:id].is_a?(Enumerable) ? params[:id].map(&:to_i) : [params[:id].to_i]
- @accounts = Account.where(id: ids).select('id')
+ @accounts = Account.where(id: ids).select('id, domain')

This comment has been minimized.

@Gargron

Gargron Jan 19, 2017

Member

Dunno what you're doing here tho!

@Gargron

Gargron Jan 19, 2017

Member

Dunno what you're doing here tho!

This comment has been minimized.

@deckycoss

deckycoss Jan 19, 2017

i think i was testing something that i didn't quite understand from @hach-que 's closed patch, and forgot to revert it

@deckycoss

deckycoss Jan 19, 2017

i think i was testing something that i didn't quite understand from @hach-que 's closed patch, and forgot to revert it

+ @current_account = current_account
+ end
+
+ def blocked

This comment has been minimized.

@Gargron

Gargron Jan 22, 2017

Member

If it returns a boolean, the convention is to end the method name with ?

@Gargron

Gargron Jan 22, 2017

Member

If it returns a boolean, the convention is to end the method name with ?

@deckycoss

This comment has been minimized.

Show comment
Hide comment
@deckycoss

deckycoss Jan 26, 2017

@Gargron see my last few messages on masto

@Gargron see my last few messages on masto

@deckycoss

This comment has been minimized.

Show comment
Hide comment
@deckycoss

deckycoss Jan 28, 2017

@Gargron i think i finally managed to merge from upstream without breaking anything. this patch is done until i receive any feedback suggesting otherwise.

by the way, i never figured out why the tests originally passed "blocking?" an array, since whenever i do this the result is always false, even if the array matches the set of accounts that are being blocked. i was able to make the test failures go away by adding return false unless other_account.is_a?(Account) to my "blocking_account_or_domain?" method, thus preventing arrays from being used at all, but that felt like a weird solution so i haven't pushed it yet.

@Gargron i think i finally managed to merge from upstream without breaking anything. this patch is done until i receive any feedback suggesting otherwise.

by the way, i never figured out why the tests originally passed "blocking?" an array, since whenever i do this the result is always false, even if the array matches the set of accounts that are being blocked. i was able to make the test failures go away by adding return false unless other_account.is_a?(Account) to my "blocking_account_or_domain?" method, thus preventing arrays from being used at all, but that felt like a weird solution so i haven't pushed it yet.

@tobascodagama

This comment has been minimized.

Show comment
Hide comment
@tobascodagama

tobascodagama Apr 24, 2017

Is there a reason this was closed?

Is there a reason this was closed?

@staticsafe

This comment has been minimized.

Show comment
Hide comment
@staticsafe

staticsafe Apr 24, 2017

Contributor

This issue is being tackled in issue #2381. You can follow that one for updates.

Contributor

staticsafe commented Apr 24, 2017

This issue is being tackled in issue #2381. You can follow that one for updates.

abcang added a commit to pixiv/mastodon that referenced this pull request Oct 19, 2017

Merge pull request #501 from pixiv/initialize
Improve music video generation

rtucker pushed a commit to vulpineclub/mastodon that referenced this pull request Jun 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment