function onHandleQueuedNotice($notice)
{
- if ($notice->is_local == 1) {
+ if (intval($notice->is_local) === Notice::LOCAL_PUBLIC) {
// Try to avoid actually mucking with the
// notice content
$c = $notice->content;
$this->notice = $notice;
- // Ignoring results
- common_replace_urls_callback($c,
- array($this, 'linkbackUrl'));
+
+ if(!$notice->getProfile()->
+ getPref("linkbackplugin", "disable_linkbacks")
+ ) {
+ // Ignoring results
+ common_replace_urls_callback($c,
+ array($this, 'linkbackUrl'));
+ }
if($notice->isRepeat()) {
$repeat = Notice::getByID($notice->repeat_of);
$parent = $notice->getParent();
$this->linkbackUrl($parent->getUrl());
}
+
+ $replyProfiles = Profile::multiGet('id', $notice->getReplies());
+ foreach($replyProfiles->fetchAll('profileurl') as $profileurl) {
+ $this->linkbackUrl($profileurl);
+ }
}
return true;
}
$request = HTTPClient::start();
try {
+ $request->setBody(xmlrpc_encode_request('pingback.ping', $args));
$response = $request->post($endpoint,
array('Content-Type: text/xml'),
- xmlrpc_encode_request('pingback.ping', $args));
+ false);
$response = xmlrpc_decode($response->getBody());
if (xmlrpc_is_fault($response)) {
common_log(LOG_WARNING,
'or <a href="http://www.movabletype.org/docs/mttrackback.html">Trackback</a> protocols.'));
return true;
}
+
+ public function onStartInitializeRouter(URLMapper $m)
+ {
+ $m->connect('settings/linkback', array('action' => 'linkbacksettings'));
+ return true;
+ }
+
+ function onEndAccountSettingsNav($action)
+ {
+ $action_name = $action->trimmed('action');
+
+ $action->menuItem(common_local_url('linkbacksettings'),
+ // TRANS: OpenID plugin menu item on user settings page.
+ _m('MENU', 'Send Linkbacks'),
+ // TRANS: OpenID plugin tooltip for user settings menu item.
+ _m('Opt-out of sending linkbacks.'),
+ $action_name === 'linkbacksettings');
+ return true;
+ }
}