From: Brion Vibber Date: Thu, 4 Mar 2010 19:00:02 +0000 (-0800) Subject: Set up subscription to update@status.net for admin user on new installation, if OStat... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=89833ce1ff187e29de4250787c5dca4cf4f5ab6b;p=quix0rs-gnu-social.git Set up subscription to update@status.net for admin user on new installation, if OStatus is set up and working. (Will fail gracefully on a behind-the-firewall site.) --- diff --git a/install.php b/install.php index bb53e2b55b..8c9b6138b8 100644 --- a/install.php +++ b/install.php @@ -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 update@status.net."); + } catch (Exception $e) { + updateStatus("Could not set up subscription to update@status.net."); + } + } return true; }