diff options
Diffstat (limited to 'plugins/TwitterBridge/twittersettings.php')
-rw-r--r-- | plugins/TwitterBridge/twittersettings.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/TwitterBridge/twittersettings.php b/plugins/TwitterBridge/twittersettings.php index 33c5eb65b..de1ba58b0 100644 --- a/plugins/TwitterBridge/twittersettings.php +++ b/plugins/TwitterBridge/twittersettings.php @@ -285,6 +285,7 @@ class TwittersettingsAction extends ConnectSettingsAction } $original = clone($flink); + $wasReceiving = (bool)($original->notice_sync & FOREIGN_NOTICE_RECV); $flink->set_flags($noticesend, $noticerecv, $replysync, $friendsync); $result = $flink->update($original); @@ -294,6 +295,22 @@ class TwittersettingsAction extends ConnectSettingsAction 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) + { + $data = array('for_user' => $twitterUserId, + 'action' => $receiving ? 'stop' : 'start'); + $qm = QueueManager::get(); + $qm->enqueue($data, 'twitterctl'); + } + } |