]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Set up subscription to update@status.net for admin user on new installation, if OStat...
authorBrion Vibber <brion@pobox.com>
Thu, 4 Mar 2010 19:00:02 +0000 (11:00 -0800)
committerBrion Vibber <brion@pobox.com>
Thu, 4 Mar 2010 19:00:02 +0000 (11:00 -0800)
install.php

index bb53e2b55b4b5a3f08c07951a7f1de14cc8da808..8c9b6138b8e06563d03112520b774d49714e599a 100644 (file)
@@ -865,6 +865,19 @@ function registerInitialUser($nickname, $password, $email)
     $user->grantRole('owner');
     $user->grantRole('moderator');
     $user->grantRole('administrator');
+    
+    // Attempt to do a remote subscribe to update@status.net
+    // Will fail if instance is on a private network.
+
+    if (class_exists('Ostatus_profile')) {
+        try {
+            $oprofile = Ostatus_profile::ensureProfile('http://update.status.net/');
+            Subscription::start($user->getProfile(), $oprofile->localProfile());
+            updateStatus("Set up subscription to <a href='http://update.status.net/'>update@status.net</a>.");
+        } catch (Exception $e) {
+            updateStatus("Could not set up subscription to <a href='http://update.status.net/'>update@status.net</a>.");
+        }
+    }
 
     return true;
 }