summaryrefslogtreecommitdiff
path: root/create.rb
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2023-09-14 21:14:29 +0200
committerpdp8 <pdp8@pdp8.info>2023-09-14 21:14:29 +0200
commit4dabdfb47154014f491462b026882102b5e668e3 (patch)
tree2303f69d1eb42372264c878731fb7c908e28ec18 /create.rb
parent44967ae9f605ca37b6d88e4e8b11a9cf1fdc2b57 (diff)
mention for mastodon DM
Diffstat (limited to 'create.rb')
-rw-r--r--create.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/create.rb b/create.rb
index 40e1357..0798ba1 100644
--- a/create.rb
+++ b/create.rb
@@ -67,6 +67,16 @@ post '/create' do
end
end
+ # https://docs.joinmastodon.org/spec/activitypub/#Mention
+ if to.size == 1 # mastodon DM
+ m = {
+ 'type' => 'Mention',
+ 'href' => to[0],
+ 'name' => mention(to[0])
+ }
+ tag << m unless tag.include? m
+ end
+
object = {
'to' => to,
'type' => 'Note',