the private message stream is different to normal streams, improving the ui a bit and collapsing conversations

This commit is contained in:
Sam
2013-05-20 16:44:06 +10:00
parent b9c4bf9870
commit e91ed83586
5 changed files with 118 additions and 4 deletions

View File

@ -2,14 +2,22 @@ class UserActionsController < ApplicationController
def index
requires_parameters(:user_id)
per_chunk = 60
render json: UserAction.stream(
opts = {
user_id: params[:user_id].to_i,
offset: params[:offset],
limit: per_chunk,
action_types: (params[:filter] || "").split(","),
action_types: (params[:filter] || "").split(",").map(&:to_i),
guardian: guardian,
ignore_private_messages: params[:filter] ? false : true
)
}
if opts[:action_types] == [UserAction::GOT_PRIVATE_MESSAGE] ||
opts[:action_types] == [UserAction::NEW_PRIVATE_MESSAGE]
render json: UserAction.private_message_stream(opts[:action_types][0], opts)
else
render json: UserAction.stream(opts)
end
end
def show