Skip to content
Permalink
Browse files

Merge pull request #359 from pooza/2_1_13

2.1.13
  • Loading branch information...
pooza committed Mar 11, 2019
2 parents 28783b0 + f2405fe commit 11672cd45dc901075fba4ca4e8d998035baf7cdc
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/mulukhiya_toot_proxy/server.rb
@@ -11,12 +11,12 @@ def before_post
(@config['/instance_url'] || "https://#{@headers['HTTP_HOST']}"),
@headers['HTTP_AUTHORIZATION'].split(/\s+/)[1],
)
@tags = params['status'].scan(
Regexp.new(@config['/mastodon/hashtag/pattern'], Regexp::IGNORECASE),
)
end

post '/api/v1/statuses' do
tags = params['status'].scan(
Regexp.new(@config['/mastodon/hashtag/pattern'], Regexp::IGNORECASE),
)
results = []
Handler.all do |handler|
Timeout.timeout(handler.timeout) do
@@ -32,7 +32,7 @@ def before_post
r = @mastodon.toot(params)
@renderer.message = r.parsed_response
@renderer.message['results'] = results.join(', ')
@renderer.message['tags'].keep_if{|v| @tags.include?(v['name'])}
@renderer.message['tags']&.keep_if{|v| tags.include?(v['name'])}
@renderer.status = r.code
headers({'X-Mulukhiya' => results.join(', ')})
return @renderer.to_s

0 comments on commit 11672cd

Please sign in to comment.
You can’t perform that action at this time.