projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix tests relying on old behavior. Use the Upload.base_url, Luke.
[akkoma]
/
lib
/
pleroma
/
chat.ex
diff --git
a/lib/pleroma/chat.ex
b/lib/pleroma/chat.ex
index 202fffb8adf0d968271fe4401e035b464c06b5bc..28007cd9f4b945795d0774182342395ee47c85e6 100644
(file)
--- a/
lib/pleroma/chat.ex
+++ b/
lib/pleroma/chat.ex
@@
-8,6
+8,7
@@
defmodule Pleroma.Chat do
import Ecto.Changeset
import Ecto.Query
import Ecto.Changeset
import Ecto.Query
+ alias Pleroma.Chat
alias Pleroma.Repo
alias Pleroma.User
alias Pleroma.Repo
alias Pleroma.User
@@
-85,4
+86,12
@@
defmodule Pleroma.Chat do
conflict_target: [:user_id, :recipient]
)
end
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]
+ )
+ end
end
end