]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/PortableContact.php
rewrote based on CR by @Annando, thank you. It is now clear to me.
[friendica.git] / src / Protocol / PortableContact.php
index f7ea27d67972522d2efa3bc3d9994a3676145d59..672956ffb952fe492b23262b9031fe55e3f8e6ee 100644 (file)
@@ -18,6 +18,7 @@ use Friendica\Model\Profile;
 use Friendica\Network\Probe;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Network;
+use Friendica\Protocol\Diaspora;
 use dba;
 use DOMDocument;
 use DOMXPath;
@@ -1421,7 +1422,7 @@ class PortableContact
                        // Avoid duplicates
                        $tags = [];
                        foreach ($data->tags as $tag) {
-                               $tag = strtolower($tag);
+                               $tag = mb_strtolower($tag);
                                $tags[$tag] = $tag;
                        }
 
@@ -1429,6 +1430,20 @@ class PortableContact
                                dba::insert('gserver-tag', ['gserver-id' => $gserver['id'], 'tag' => $tag]);
                        }
                }
+
+               // Create or update the relay contact
+               $fields = [];
+               if (isset($data->protocols)) {
+                       if (isset($data->protocols->diaspora)) {
+                               $fields['network'] = NETWORK_DIASPORA;
+                               $fields['batch'] = $data->protocols->diaspora;
+                       }
+                       if (isset($data->protocols->dfrn)) {
+                               $fields['network'] = NETWORK_DFRN;
+                               $fields['batch'] = $data->protocols->dfrn;
+                       }
+               }
+               Diaspora::setRelayContact($server_url, $fields);
        }
 
        /**