projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Broadcast conversation update when DM is deleted
[akkoma]
/
lib
/
pleroma
/
object.ex
diff --git
a/lib/pleroma/object.ex
b/lib/pleroma/object.ex
index 3ffa290ebee33fe40ece3bba9347409a288cdc02..4b181ec59f0ab225d3c1c44add562587036cf226 100644
(file)
--- a/
lib/pleroma/object.ex
+++ b/
lib/pleroma/object.ex
@@
-133,6
+133,13
@@
defmodule Pleroma.Object do
end
end
end
end
+ def prune(%Object{data: %{"id" => id}} = object) do
+ with {:ok, object} <- Repo.delete(object),
+ {:ok, true} <- Cachex.del(:object_cache, "object:#{id}") do
+ {:ok, object}
+ end
+ end
+
def set_cache(%Object{data: %{"id" => ap_id}} = object) do
Cachex.put(:object_cache, "object:#{ap_id}", object)
{:ok, object}
def set_cache(%Object{data: %{"id" => ap_id}} = object) do
Cachex.put(:object_cache, "object:#{ap_id}", object)
{:ok, object}