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 #26 )
Mentioning user should work in same way as hashtags works
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
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 getuser_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 #26 )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'}
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" }, ] } }
`