sources: fix sources sometimes choosing wrong strategy (fix #3968)
Fix sources choosing the wrong strategy when the referer belongs to a different site (for example, when uploading a twitter post with a pixiv referer). * Fix `match?` to only consider the main url, not the referer. * Change `match?` to match against a list of domains given by the `domains` method. * Change `match?` to an instance method.
This commit is contained in:
@@ -2,10 +2,8 @@ module Sources::Strategies
|
||||
class Pawoo < Base
|
||||
IMAGE = %r!\Ahttps?://img\.pawoo\.net/media_attachments/files/(\d+/\d+/\d+)!
|
||||
|
||||
def self.match?(*urls)
|
||||
urls.compact.any? do |x|
|
||||
x =~ IMAGE || PawooApiClient::Status.is_match?(x) || PawooApiClient::Account.is_match?(x)
|
||||
end
|
||||
def domains
|
||||
["pawoo.net"]
|
||||
end
|
||||
|
||||
def site_name
|
||||
|
||||
Reference in New Issue
Block a user