exit(1);
}
-require_once INSTALLDIR . '/lib/connectsettingsaction.php';
require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
/**
*
* @see SettingsAction
*/
-class TwittersettingsAction extends ConnectSettingsAction
+class TwittersettingsAction extends ProfileSettingsAction
{
/**
* Title of the page
if (!$user->password) {
$this->elementStart('p', array('class' => 'form_guide'));
+ // @todo FIXME: Bad i18n (patchwork in three parts).
$this->text(_m('Disconnecting your Twitter ' .
'could make it impossible to log in! Please '));
$this->element('a',
if (common_config('twitterimport','enabled')) {
$this->elementStart('li');
$this->checkbox('noticerecv',
- _m('Import my Friends Timeline.'),
+ _m('Import my friends timeline.'),
($flink) ?
($flink->noticesync & FOREIGN_NOTICE_RECV) :
false);
$user = common_current_user();
$flink = Foreign_link::getByUserID($user->id, TWITTER_SERVICE);
+ if (empty($flink)) {
+ $this->clientError(_m('No Twitter connection to remove.'));
+ return;
+ }
+
$result = $flink->safeDelete();
if (empty($result)) {
}
$original = clone($flink);
+ $wasReceiving = (bool)($original->noticesync & FOREIGN_NOTICE_RECV);
$flink->set_flags($noticesend, $noticerecv, $replysync, $friendsync);
$result = $flink->update($original);
return;
}
+ if ($wasReceiving xor $noticerecv) {
+ $this->notifyDaemon($flink->foreign_id, $noticerecv);
+ }
+
$this->showForm(_m('Twitter preferences saved.'), true);
}
+
+ /**
+ * Tell the import daemon that we've updated a user's receive status.
+ */
+ function notifyDaemon($twitterUserId, $receiving)
+ {
+ // todo... should use control signals rather than queues
+ }
+
}