projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'tests/web/mastodon_api/search_controller' into 'develop'
[akkoma]
/
lib
/
pleroma
/
conversation.ex
diff --git
a/lib/pleroma/conversation.ex
b/lib/pleroma/conversation.ex
index 0c6ca9f72e0f6f69ff3aa74ad56b486fb6eff830..bc97b39ca6e6229d888f6fd721747e48f3579115 100644
(file)
--- a/
lib/pleroma/conversation.ex
+++ b/
lib/pleroma/conversation.ex
@@
-45,11
+45,11
@@
defmodule Pleroma.Conversation do
2. Create a participation for all the people involved who don't have one already
3. Bump all relevant participations to 'unread'
"""
2. Create a participation for all the people involved who don't have one already
3. Bump all relevant participations to 'unread'
"""
- def create_or_bump_for(activity) do
+ def create_or_bump_for(activity
, opts \\ []
) do
with true <- Pleroma.Web.ActivityPub.Visibility.is_direct?(activity),
with true <- Pleroma.Web.ActivityPub.Visibility.is_direct?(activity),
- object <- Pleroma.Object.normalize(activity),
"Create" <- activity.data["type"],
"Create" <- activity.data["type"],
- "Note" <- object.data["type"],
+ object <- Pleroma.Object.normalize(activity),
+ true <- object.data["type"] in ["Note", "Question"],
ap_id when is_binary(ap_id) and byte_size(ap_id) > 0 <- object.data["context"] do
{:ok, conversation} = create_for_ap_id(ap_id)
ap_id when is_binary(ap_id) and byte_size(ap_id) > 0 <- object.data["context"] do
{:ok, conversation} = create_for_ap_id(ap_id)
@@
-58,7
+58,7
@@
defmodule Pleroma.Conversation do
participations =
Enum.map(users, fn user ->
{:ok, participation} =
participations =
Enum.map(users, fn user ->
{:ok, participation} =
- Participation.create_for_user_and_conversation(user, conversation)
+ Participation.create_for_user_and_conversation(user, conversation
, opts
)
participation
end)
participation
end)
@@
-84,7
+84,7
@@
defmodule Pleroma.Conversation do
Repo.transaction(
fn ->
stream
Repo.transaction(
fn ->
stream
- |> Enum.each(
&create_or_bump_for/1
)
+ |> Enum.each(
fn a -> create_or_bump_for(a, read: true) end
)
end,
timeout: :infinity
)
end,
timeout: :infinity
)