function handle($notice) { $mirror = new SubMirror(); $mirror->subscribed = $notice->profile_id; if ($mirror->find()) { while ($mirror->fetch()) { $mirror->mirrorNotice($notice); } } return true; }
/** * 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); } } }
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; }
/** * 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); } } } }
/** * 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); } } } }
/** * 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; }
/** * 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; }