Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mentions don't work for federated "Articles" #12129

Closed
qwazix opened this issue Oct 9, 2019 · 7 comments

Comments

@qwazix
Copy link

commented Oct 9, 2019

We are trying to support sending ActivityPub mentions from writefreely but when posting a "Create" activity with an "Article" object the mentions in that Article get ignored.

Expected behaviour

The mastodon user should get a notification that somebody mentioned them. (This works in pleroma and it also works if I use a custom writefreely build with the "object" type as "Note" instead of "Article"

Actual behaviour

Nothing happens. The mentioned users are never notified.

Steps to reproduce the problem

You can try with the branch activitypub-mentions from writefreely. Changing the type to NewNoteObject in posts.go#1072 shows how the feature should be working.

Specifications

I tested with mastodon 3.0.0 on fosstodon.org. The post does federate with the instance even as nobody follows me from there but it never reaches the intended user.


image

image

@dariusk

This comment has been minimized.

Copy link
Contributor

commented Oct 9, 2019

@qwazix Can you try mentioning @darius@friend.camp in a test post? My instance runs a fork that supports Article posts (aka doesn't convert them into a URL stub) and if for some reason the mentions work I might be able to make a PR to fix this bug.

@Gargron

This comment has been minimized.

Copy link
Member

commented Oct 9, 2019

I think we process Article posts the exact same way as Note with the exception of a cosmetic change of the body of the post. Mentions are separate from the body so that should not have an effect on them. If you are implementing mentions for the first time, maybe something about the way you describe them is wrong. For example, I think we don’t notify about mentions unless the person is also addressed in to/cc

@qwazix

This comment has been minimized.

Copy link
Author

commented Oct 9, 2019

I'm pretty sure that the description is correct because if I change the object type to "Note" the mentions appear in the notifications as expected. (Unless I'm thrown off by something else) The mentions also work in pleroma which is another good indicator that they are described correctly.

The persons are addressed in CC (not To though)

image

I will post the json later if that would be helpful (I'm on another computer now)

@Gargron

This comment has been minimized.

Copy link
Member

commented Oct 9, 2019

The ActivityPub::Activity::Create class which processes mentions makes checks against the type only for summary and content. Otherwise, the checks happen before, deciding whether to process the object as a whole or not. So unfortunately I do not see anything obvious that would make mentions not work for Articles if they work for Notes.

@qwazix

This comment has been minimized.

Copy link
Author

commented Oct 10, 2019

Ok, I'm sorry for this. You are indeed correct. The issue was that the iri in the CC field needed to be
https://mastodon.social/users/qwazix and not https://mastodon.social/@qwazix/

Is this something you are interested in fixing? Should I open a new issue?

@Gargron

This comment has been minimized.

Copy link
Member

commented Oct 10, 2019

No, I don't think that could be considered a bug. The longer version is the URI, and the shorter, prettier version is the user-facing URL, they are not the same. (Now, the Mention objects refer to the URL using href instead of the URI, which is annoying, but that's how ActivityPub was designed)

@Gargron Gargron closed this Oct 10, 2019
@thebaer

This comment has been minimized.

Copy link

commented Oct 10, 2019

Thanks for the help, @Gargron! Fixed on our end and working really nicely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.