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

Implement mentions #27

Open
autogestion opened this issue Mar 21, 2020 · 1 comment · Fixed by #28
Open

Implement mentions #27

autogestion opened this issue Mar 21, 2020 · 1 comment · Fixed by #28
Labels
help wanted Extra attention is needed svelte

Comments

@autogestion
Copy link
Owner

autogestion commented Mar 21, 2020

Mentioning user should work in same way as hashtags works

  1. detect mentions in text in same way as for hashtags https://github.com/autogestion/pubgate-philip/blob/master/philip/src/components/Publish.svelte#L11
    mention format is @username@domain

  2. wrap it in html, same as mastodon does (so it will be displayed at mastodon servers correctly
    html format is <span ' 'class="h-card"><a' 'href="<user_id>" ' 'class="u-url mention">@<span>username</span></a></span></p>'
    to get user_id, it should be fetched from mentioned user server, by using FollowYourNose principle ( https://domain/@username) or by using webfinger (to be compatible with pleroma, as described in Use webfinger to discover users from Pleroma servers #26 )

  3. Create mention sub-object, same as for hashtag
    https://github.com/autogestion/pubgate-philip/blob/master/philip/src/components/Publish.svelte#L27
    sub-object format {'href': '<user_id>', 'name': '@username@domain', 'type': 'Mention'}

  4. Add to Create object cc attribute, same as when making a comment
    'cc': [user_id]

Final output, sent to outbox, should be
{ "type": "Create", "cc": [<user_id>] "object": { "type": "Note", "content": "<span ' 'class="h-card"><a' 'href="<user_id>" ' 'class="u-url mention">@<span>username</span></a></span></p>", "tag": [ { "type": "Mention", "href": "<user_id>", "name": "@username@domain" }, ] } }

`

traumschule pushed a commit to traumschule/pubgate-philip that referenced this issue Mar 21, 2020
@autogestion autogestion linked a pull request Mar 23, 2020 that will close this issue
5 tasks
autogestion pushed a commit that referenced this issue Mar 28, 2020
* implement mentions (fixes #27)

* Search: fallback to webfinger (fixes #26)

- Publish ("Create"): separate publish and sendPost 
- Search: factor out requests to utils/user.js
- needs testing for non-pgi

Co-authored-by: traumschule <[email protected]>
@autogestion
Copy link
Owner Author

Implement mentions for Pleroma users, which do no have FollowYourNose ids and their id url have to be autodiscovered via webfinger

@autogestion autogestion reopened this Mar 28, 2020
@autogestion autogestion added help wanted Extra attention is needed svelte labels Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed svelte
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant