2022-06-19 15:59:47 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Moderation::InboxController < ApplicationController
|
|
|
|
before_action :authenticate_user!
|
|
|
|
|
|
|
|
def index
|
|
|
|
@user = User.find_by(screen_name: params[:user])
|
|
|
|
@inboxes = @user.cursored_inbox(last_id: params[:last_id])
|
|
|
|
@inbox_last_id = @inboxes.map(&:id).min
|
|
|
|
@more_data_available = !@user.cursored_inbox(last_id: @inbox_last_id, size: 1).count.zero?
|
|
|
|
@inbox_count = @user.inboxes.count
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html
|
2022-09-04 14:22:51 -07:00
|
|
|
format.turbo_stream
|
2022-06-19 15:59:47 -07:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|