From 4dabdfb47154014f491462b026882102b5e668e3 Mon Sep 17 00:00:00 2001 From: pdp8 Date: Thu, 14 Sep 2023 21:14:29 +0200 Subject: mention for mastodon DM --- create.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'create.rb') 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', -- cgit v1.2.3