$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
+ }
+
}