]> git.mxchange.org Git - friendica.git/commitdiff
Adopt the relay definition according to the suggestions from @jaywink
authorMichael <heluecht@pirati.ca>
Thu, 10 May 2018 11:04:18 +0000 (11:04 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 10 May 2018 11:04:18 +0000 (11:04 +0000)
mod/_well_known.php
src/Protocol/PortableContact.php

index 782dc7a1b145973eb2a1b061701f89c37ac17d80..407fc756a931fef7cfe0a39adc79816def46b1b6 100644 (file)
@@ -73,8 +73,8 @@ function wk_social_relay()
                'subscribe' => $subscribe,
                'scope' => $scope,
                'tags' => $taglist,
-               'protocols' => ['diaspora' => System::baseUrl() . '/receive/public',
-                       'dfrn' => System::baseUrl() . '/dfrn_notify']
+               'protocols' => ['diaspora' => ['receive' => System::baseUrl() . '/receive/public'],
+                       'dfrn' => ['receive' => System::baseUrl() . '/dfrn_notify']]
        ];
 
        header('Content-type: application/json; charset=utf-8');
index 672956ffb952fe492b23262b9031fe55e3f8e6ee..d737f4d5afeb6ed4076510a9442b18cf1cace549 100644 (file)
@@ -1436,11 +1436,19 @@ class PortableContact
                if (isset($data->protocols)) {
                        if (isset($data->protocols->diaspora)) {
                                $fields['network'] = NETWORK_DIASPORA;
-                               $fields['batch'] = $data->protocols->diaspora;
+                               if (isset($data->protocols->diaspora->receive)) {
+                                       $fields['batch'] = $data->protocols->diaspora->receive;
+                               } elseif (is_string($data->protocols->diaspora)) {
+                                       $fields['batch'] = $data->protocols->diaspora;
+                               }
                        }
                        if (isset($data->protocols->dfrn)) {
                                $fields['network'] = NETWORK_DFRN;
-                               $fields['batch'] = $data->protocols->dfrn;
+                               if (isset($data->protocols->dfrn->receive)) {
+                                       $fields['batch'] = $data->protocols->dfrn->receive;
+                               } elseif (is_string($data->protocols->dfrn)) {
+                                       $fields['batch'] = $data->protocols->dfrn;
+                               }
                        }
                }
                Diaspora::setRelayContact($server_url, $fields);