about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-08-07 00:20:41 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:17 -0500
commit256e85e32608f012209fd1d52486174995b77905 (patch)
tree37cef8207a19ae8c364243bac597a4c45df97e72 /lib
parent93b17730518898d7de5ce1a3c6cc4df40f30c79d (diff)
[Feature, Federation] Add support for arbitarty account and server metadata fields
Diffstat (limited to 'lib')
-rw-r--r--lib/mastodon/version.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb
index 1a8aabe8c..0cad7a273 100644
--- a/lib/mastodon/version.rb
+++ b/lib/mastodon/version.rb
@@ -56,5 +56,40 @@ module Mastodon
     def user_agent
       @user_agent ||= "#{HTTP::Request::USER_AGENT} (Mastodon/#{Version}; +http#{Rails.configuration.x.use_https ? 's' : ''}://#{Rails.configuration.x.web_domain}/)"
     end
+
+    def server_metadata_json
+      @server_metadata_json ||= [
+        {
+          '@context': { 'schema': 'http://schema.org/', name: 'schema:name', value: 'schema:value' },
+          type: 'PropertyValue',
+          name: 'version',
+          value: to_s,
+        },
+        {
+          '@context': { 'schema': 'http://schema.org/', name: 'schema:name', value: 'schema:value' },
+          type: 'PropertyValue',
+          name: 'monsterpit:extensions',
+          value: '2020.08.06.1',
+        },
+        {
+          '@context': { 'schema': 'http://schema.org/', name: 'schema:name', value: 'schema:value' },
+          type: 'PropertyValue',
+          name: 'comment:0',
+          value: "big tails can't fail",
+        },
+        {
+          '@context': { 'schema': 'http://schema.org/', name: 'schema:name', value: 'schema:value' },
+          type: 'PropertyValue',
+          name: 'comment:1',
+          value: 'trans rights!',
+        },
+        {
+          '@context': { 'schema': 'http://schema.org/', name: 'schema:name', value: 'schema:value' },
+          type: 'PropertyValue',
+          name: 'comment:2',
+          value: 'gently the kobolds',
+        },
+      ]
+    end
   end
 end