Streamer: Don't crash on streaming chat notifications
This commit is contained in:
parent
2c25087d20
commit
dbd07d29a3
2 changed files with 20 additions and 4 deletions
|
|
@ -467,12 +467,13 @@ defmodule Pleroma.Web.CommonAPI do
|
|||
{:ok, activity}
|
||||
end
|
||||
|
||||
def thread_muted?(%{id: nil} = _user, _activity), do: false
|
||||
|
||||
def thread_muted?(user, activity) do
|
||||
ThreadMute.exists?(user.id, activity.data["context"])
|
||||
def thread_muted?(%User{id: user_id}, %{data: %{"context" => context}})
|
||||
when is_binary("context") do
|
||||
ThreadMute.exists?(user_id, context)
|
||||
end
|
||||
|
||||
def thread_muted?(_, _), do: false
|
||||
|
||||
def report(user, data) do
|
||||
with {:ok, account} <- get_reported_account(data.account_id),
|
||||
{:ok, {content_html, _, _}} <- make_report_content_html(data[:comment]),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue