aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/user.ex
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-07-02 15:01:59 +0200
committerRoger Braun <roger@rogerbraun.net>2017-07-02 15:01:59 +0200
commite343c0c9c42968316c93ebb52a570ccd5778acb0 (patch)
treec8e2f4213a46913f0ca3cd54bd25056bd9506d67 /lib/pleroma/user.ex
parent5d8352a4296dc06fd548f3e53db3f1f38040cfd0 (diff)
downloadpleroma-e343c0c9c42968316c93ebb52a570ccd5778acb0.tar.gz
Add way to update most recent notification id.
Diffstat (limited to 'lib/pleroma/user.ex')
-rw-r--r--lib/pleroma/user.ex6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index 23e650ce5..a30c8daed 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -46,6 +46,12 @@ defmodule Pleroma.User do
|> validate_required([:following])
end
+ def info_changeset(struct, params \\ %{}) do
+ struct
+ |> cast(params, [:info])
+ |> validate_required([:info])
+ end
+
def user_info(%User{} = user) do
note_count_query = from a in Object,
where: fragment("? @> ?", a.data, ^%{actor: user.ap_id, type: "Note"}),