projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Reblog API
[akkoma]
/
lib
/
pleroma
/
upload
/
filter.ex
diff --git
a/lib/pleroma/upload/filter.ex
b/lib/pleroma/upload/filter.ex
index f7257be653519277c2b7c6e4b24aefc28bc62f1b..c677d4b9fcb107007ee4ae9fe9d1b00966fc69f9 100644
(file)
--- a/
lib/pleroma/upload/filter.ex
+++ b/
lib/pleroma/upload/filter.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
18
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
21
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Upload.Filter do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Upload.Filter do
@@
-15,7
+15,11
@@
defmodule Pleroma.Upload.Filter do
require Logger
require Logger
- @callback filter(Pleroma.Upload.t()) :: :ok | {:ok, Pleroma.Upload.t()} | {:error, any()}
+ @callback filter(Pleroma.Upload.t()) ::
+ {:ok, :filtered}
+ | {:ok, :noop}
+ | {:ok, :filtered, Pleroma.Upload.t()}
+ | {:error, any()}
@spec filter([module()], Pleroma.Upload.t()) :: {:ok, Pleroma.Upload.t()} | {:error, any()}
@spec filter([module()], Pleroma.Upload.t()) :: {:ok, Pleroma.Upload.t()} | {:error, any()}
@@
-25,10
+29,13
@@
defmodule Pleroma.Upload.Filter do
def filter([filter | rest], upload) do
case filter.filter(upload) do
def filter([filter | rest], upload) do
case filter.filter(upload) do
-
:ok
->
+
{:ok, :filtered}
->
filter(rest, upload)
filter(rest, upload)
- {:ok, upload} ->
+ {:ok, :filtered, upload} ->
+ filter(rest, upload)
+
+ {:ok, :noop} ->
filter(rest, upload)
error ->
filter(rest, upload)
error ->