following_count: length(user.following) - oneself,
note_count: user.info["note_count"] || 0,
follower_count: user.info["follower_count"] || 0,
- locked: user.info["locked"] || false
+ locked: user.info["locked"] || false,
+ default_scope: user.info["default_scope"] || "public"
}
end
# ensure that the actor who published the announced object appears only once
to =
if actor.nickname != nil do
- (to ++ [object.data["actor"]])
+ to ++ [object.data["actor"]]
else
to
end
)
end
+ def moderator_user_query() do
+ from(
+ u in User,
+ where: u.local == true,
+ where: fragment("?->'is_moderator' @> 'true'", u.info)
+ )
+ end
+
def deactivate(%User{} = user) do
new_info = Map.put(user.info, "deactivated", true)
cs = User.info_changeset(user, %{info: new_info})