function handle($notice)
 {
     $mirror = new SubMirror();
     $mirror->subscribed = $notice->profile_id;
     if ($mirror->find()) {
         while ($mirror->fetch()) {
             $mirror->mirrorNotice($notice);
         }
     }
     return true;
 }
Exemplo n.º 2
0
 /**
  * Show the form for OpenID management
  *
  * We have one form with a few different submit buttons to do different things.
  *
  * @return void
  */
 function showContent()
 {
     $user = common_current_user();
     $this->showAddFeedForm();
     $mirror = new SubMirror();
     $mirror->subscriber = $user->id;
     if ($mirror->find()) {
         while ($mirror->fetch()) {
             $this->showFeedForm($mirror);
         }
     }
 }
Exemplo n.º 3
0
 function handle($notice)
 {
     $mirror = new SubMirror();
     $mirror->subscribed = $notice->profile_id;
     if ($mirror->find()) {
         while ($mirror->fetch()) {
             try {
                 $mirror->mirrorNotice($notice);
             } catch (Exception $e) {
                 common_log(LOG_ERR, "Exception trying to mirror notice {$notice->id} " . "for subscriber {$mirror->subscriber} ({$mirror->style}): " . $e->getMessage());
             }
         }
     }
     return true;
 }
Exemplo n.º 4
0
 /**
  * Show the form for OpenID management
  *
  * We have one form with a few different submit buttons to do different things.
  *
  * @return void
  */
 function showContent()
 {
     $provider = $this->trimmed('provider');
     if (!empty($provider) || GNUsocial::isAjax()) {
         $this->showAddFeedForm($provider);
     } else {
         $this->elementStart('div', array('id' => 'add-mirror'));
         $this->showAddWizard();
         $this->elementEnd('div');
         $mirror = new SubMirror();
         $mirror->subscriber = $this->scoped->getID();
         if ($mirror->find()) {
             while ($mirror->fetch()) {
                 $this->showFeedForm($mirror);
             }
         }
     }
 }
Exemplo n.º 5
0
 /**
  * Show the form for OpenID management
  *
  * We have one form with a few different submit buttons to do different things.
  *
  * @return void
  */
 function showContent()
 {
     $user = common_current_user();
     $provider = $this->trimmed('provider');
     if ($provider) {
         $this->showAddFeedForm($provider);
     } else {
         $this->elementStart('div', array('id' => 'add-mirror'));
         $this->showAddWizard();
         $this->elementEnd('div');
         $mirror = new SubMirror();
         $mirror->subscriber = $user->id;
         if ($mirror->find()) {
             while ($mirror->fetch()) {
                 $this->showFeedForm($mirror);
             }
         }
     }
 }
Exemplo n.º 6
0
 /**
  * Let the OStatus subscription garbage collection know if we're
  * making use of a remote feed, so it doesn't get dropped out
  * from under us.
  *
  * @param Ostatus_profile $oprofile
  * @param int $count in/out
  * @return mixed hook return value
  */
 function onOstatus_profileSubscriberCount($oprofile, &$count)
 {
     if ($oprofile->profile_id) {
         $mirror = new SubMirror();
         $mirror->subscribed = $oprofile->profile_id;
         if ($mirror->find()) {
             while ($mirror->fetch()) {
                 $count++;
             }
         }
     }
     return true;
 }
Exemplo n.º 7
0
 /**
  * Let the OStatus subscription garbage collection know if we're
  * making use of a remote feed, so it doesn't get dropped out
  * from under us.
  *
  * @param Ostatus_profile $oprofile
  * @param int $count in/out
  * @return mixed hook return value
  */
 function onOstatus_profileSubscriberCount(Ostatus_profile $oprofile, &$count)
 {
     try {
         $profile = $oprofile->localProfile();
         $mirror = new SubMirror();
         $mirror->subscribed = $profile->id;
         if ($mirror->find()) {
             while ($mirror->fetch()) {
                 $count++;
             }
         }
     } catch (NoProfileException $e) {
         // We can't handle this kind of Ostatus_profile since it has no
         // local profile
     }
     return true;
 }