Skip to content

Commit

Permalink
MAM-4110-threads-smart-lists (#238)
Browse files Browse the repository at this point in the history
* relay work. first try.

* return early

* update

* quick fix i hope it works god bless this commit.

* params, not form

* fix

* fix indent

* added big on threads with placeholder ID

* Update channel id for big threads list

---------

Co-authored-by: Benoit Nolens <bnolens@gmail.com>
  • Loading branch information
derspyy and bnolens authored Apr 11, 2024
1 parent d1d225a commit 1680ad2
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions app/controllers/api/v3/timelines/channels_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,36 @@ class Api::V3::Timelines::ChannelsController < Api::BaseController
end

def show
if channel_id_param == '1efe873b-0bc2-454f-9f24-a9b8b8ef3410'
response = HTTP.get(
'https://feature.moth.social/listrelay/ThreadsDevs', :params => {
:max_id => params[:max_id],
:min_id => params[:min_id],
:since_id => params[:since_id],
:limit => params[:limit]
}
)
raise NotFound, 'channel not found' unless response.code == 200

@statuses = []
render plain: response.body.to_s, content_type: "application/json"
return
end
if channel_id_param == '32d4a591-57ce-414d-ada3-38ca466977a0'
response = HTTP.get(
'https://feature.moth.social/listrelay/BigThreads', :params => {
:max_id => params[:max_id],
:min_id => params[:min_id],
:since_id => params[:since_id],
:limit => params[:limit]
}
)
raise NotFound, 'channel not found' unless response.code == 200

@statuses = []
render plain: response.body.to_s, content_type: "application/json"
return
end
@statuses = cached_channel_statuses
render json: @statuses,
each_serializer: REST::StatusSerializer,
Expand Down

0 comments on commit 1680ad2

Please sign in to comment.