Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
bb2d5879
Verified
Commit
bb2d5879
authored
Aug 11, 2021
by
Haelwenn
Browse files
maybe_notify_subscribers: Don't create notifications from ingested replies
Backport of:
!3505
parent
0e2aebd0
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
bb2d5879
...
...
@@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
-
MastodonAPI: Stream out Create activities
-
MRF ObjectAgePolicy: Fix pattern matching on "published"
-
TwitterAPI: Make
`change_password`
and
`change_email`
require params on body instead of query
-
Subscription(Bell) Notifications: Don't create from Pipeline Ingested replies
## 2.4.0 - 2021-08-08
...
...
lib/pleroma/web/common_api/utils.ex
View file @
bb2d5879
...
...
@@ -412,19 +412,14 @@ def maybe_notify_mentioned_recipients(
def
maybe_notify_mentioned_recipients
(
recipients
,
_
),
do
:
recipients
# Do not notify subscribers if author is making a reply
def
maybe_notify_subscribers
(
recipients
,
%
Activity
{
object:
%
Object
{
data:
%{
"inReplyTo"
=>
_ap_id
}}
})
do
recipients
end
def
maybe_notify_subscribers
(
recipients
,
%
Activity
{
data:
%{
"actor"
=>
actor
,
"type"
=>
type
}}
=
activity
)
when
type
==
"Create"
do
with
%
User
{}
=
user
<-
User
.
get_cached_by_ap_id
(
actor
)
do
%
Activity
{
data:
%{
"actor"
=>
actor
,
"type"
=>
"Create"
}}
=
activity
)
do
# Do not notify subscribers if author is making a reply
with
%
Object
{
data:
object
}
<-
Object
.
normalize
(
activity
,
fetch:
false
),
nil
<-
object
[
"inReplyTo"
],
%
User
{}
=
user
<-
User
.
get_cached_by_ap_id
(
actor
)
do
subscriber_ids
=
user
|>
User
.
subscriber_users
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment