Files
once-campfire/app/controllers/rooms/refreshes_controller.rb
Kevin McConnell df76a227dc Hello world
First open source release of Campfire 🎉
2025-08-21 09:31:59 +01:00

16 lines
453 B
Ruby

class Rooms::RefreshesController < ApplicationController
include RoomScoped
before_action :set_last_updated_at
def show
@new_messages = @room.messages.with_creator.page_created_since(@last_updated_at)
@updated_messages = @room.messages.without(@new_messages).with_creator.page_updated_since(@last_updated_at)
end
private
def set_last_updated_at
@last_updated_at = Time.at(0, params[:since].to_i, :millisecond)
end
end