From: Alex Gleason Date: Fri, 11 Sep 2020 19:13:38 +0000 (-0500) Subject: Merge remote-tracking branch 'upstream/develop' into chat-moderation X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=9733c9d06563a92e4c58ac906c5f98b617b9e731;p=akkoma Merge remote-tracking branch 'upstream/develop' into chat-moderation --- 9733c9d06563a92e4c58ac906c5f98b617b9e731 diff --cc lib/pleroma/chat.ex index b38c5c3dd,24a86371e..84f8806a0 --- a/lib/pleroma/chat.ex +++ b/lib/pleroma/chat.ex @@@ -71,14 -69,4 +71,12 @@@ defmodule Pleroma.Chat d conflict_target: [:user_id, :recipient] ) end + + @spec for_user_query(FlakeId.Ecto.CompatType.t()) :: Ecto.Query.t() + def for_user_query(user_id) do + from(c in Chat, + where: c.user_id == ^user_id, - order_by: [desc: c.updated_at], - inner_join: u in User, - on: u.ap_id == c.recipient ++ order_by: [desc: c.updated_at] + ) + end end