diff options
author | rinpatch <rinpatch@sdf.org> | 2020-03-01 02:03:46 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-03-01 02:03:46 +0300 |
commit | b5465bf385800d52998bca472a19ea1b9db4c252 (patch) | |
tree | eba301a4ae02e8306eb8849b8a1f0918f55921da | |
parent | e6ccf121292292d8851688822e951d6651ef3bf3 (diff) | |
download | pleroma-b5465bf385800d52998bca472a19ea1b9db4c252.tar.gz |
timeline controller: add a TODO for replacing copypaste with a macro
-rw-r--r-- | lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex b/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex index f58c1f93c..a3110c722 100644 --- a/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex @@ -14,10 +14,10 @@ defmodule Pleroma.Web.MastodonAPI.TimelineController do alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub - # XXX: Ideally these would be generated instead of copypasted, - # but I haven't been able to overcome an issue with guards when - # trying to generate these. - # See: https://elixirforum.com/t/trouble-plugging-plugs-with-generated-options-in-guards-in-a-phoenix-controller/29465 + # TODO: Replace with a macro when there is a Phoenix release with + # https://github.com/phoenixframework/phoenix/commit/2e8c63c01fec4dde5467dbbbf9705ff9e780735e + # in it + plug(RateLimiter, [name: :timeline, bucket_name: :direct_timeline] when action == :direct) plug(RateLimiter, [name: :timeline, bucket_name: :public_timeline] when action == :public) plug(RateLimiter, [name: :timeline, bucket_name: :home_timeline] when action == :home) |