projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix logic.
[akkoma]
/
lib
/
pleroma
/
user.ex
diff --git
a/lib/pleroma/user.ex
b/lib/pleroma/user.ex
index 4f5fcab5b549dd58cfdefec2e5a2b9723ec23d93..39d8cca768aeb7222b654de3d119fbf2ba409683 100644
(file)
--- a/
lib/pleroma/user.ex
+++ b/
lib/pleroma/user.ex
@@
-2,7
+2,7
@@
defmodule Pleroma.User do
use Ecto.Schema
import Ecto.{Changeset, Query}
use Ecto.Schema
import Ecto.{Changeset, Query}
- alias Pleroma.{Repo, User, Object, Web}
+ alias Pleroma.{Repo, User, Object, Web
, Activity, Notification
}
alias Comeonin.Pbkdf2
alias Pleroma.Web.{OStatus, Websub}
alias Pleroma.Web.ActivityPub.ActivityPub
alias Comeonin.Pbkdf2
alias Pleroma.Web.{OStatus, Websub}
alias Pleroma.Web.ActivityPub.ActivityPub
@@
-22,6
+22,7
@@
defmodule Pleroma.User do
field :local, :boolean, default: true
field :info, :map, default: %{}
field :follower_address, :string
field :local, :boolean, default: true
field :info, :map, default: %{}
field :follower_address, :string
+ has_many :notifications, Notification
timestamps()
end
timestamps()
end
@@
-239,4
+240,12
@@
defmodule Pleroma.User do
Repo.update(cs)
end
Repo.update(cs)
end
+
+ def get_notified_from_activity(%Activity{data: %{"to" => to}} = activity) do
+ query = from u in User,
+ where: u.ap_id in ^to,
+ where: u.local == true
+
+ Repo.all(query)
+ end
end
end