summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-10-08 09:53:21 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-10-08 09:53:21 (GMT)
commita793e9f8f6ee0e1ed52d3b9fbac7b236437d94f0 (patch)
tree036c6f09bffaa781ca07ee6105b7ebdbb5f2cd51 /Swift/Controllers
parent0f9c8582993b0714ed07366808bfccc97c35cc52 (diff)
downloadswift-a793e9f8f6ee0e1ed52d3b9fbac7b236437d94f0.zip
swift-a793e9f8f6ee0e1ed52d3b9fbac7b236437d94f0.tar.bz2
Update roster header even when going offline.
Resolves: #596 Release-Notes: The roster header will no longer show you with (No message) if you specify a message when you go offline.
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/MainController.cpp7
-rw-r--r--Swift/Controllers/MainController.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index e3079ac..ccefa4b 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -270,6 +270,7 @@ void MainController::handleConnected() {
resetCurrentError();
resetPendingReconnects();
bool freshLogin = rosterController_ == NULL;
+ myStatusLooksOnline_ = true;
if (freshLogin) {
serverDiscoInfo_ = boost::shared_ptr<DiscoInfo>(new DiscoInfo());
@@ -329,9 +330,10 @@ void MainController::reconnectAfterError() {
void MainController::handleChangeStatusRequest(StatusShow::Type show, const String &statusText) {
boost::shared_ptr<Presence> presence(new Presence());
if (show == StatusShow::None) {
- // FIXME: This is wrong. None doesn't mean unavailable
+ // Note: this is misleading, None doesn't mean unavailable on the wire.
presence->setType(Presence::Unavailable);
resetPendingReconnects();
+ myStatusLooksOnline_ = false;
}
else {
presence->setShow(show);
@@ -517,9 +519,10 @@ void MainController::logout() {
if (client_ /*&& client_->isAvailable()*/) {
client_->disconnect();
}
- if (rosterController_) {
+ if (rosterController_ && myStatusLooksOnline_) {
rosterController_->getWindow()->setMyStatusType(StatusShow::None);
rosterController_->getWindow()->setMyStatusText("");
+ myStatusLooksOnline_ = false;
}
setManagersOnline(false);
}
diff --git a/Swift/Controllers/MainController.h b/Swift/Controllers/MainController.h
index 163a260..72928d0 100644
--- a/Swift/Controllers/MainController.h
+++ b/Swift/Controllers/MainController.h
@@ -178,6 +178,7 @@ namespace Swift {
Timer::ref reconnectTimer_;
StatusTracker* statusTracker_;
MUCRegistry* mucRegistry_;
+ bool myStatusLooksOnline_;
typedef std::map<String, VCardStorage*> VCardStorageMap;
VCardStorageMap vcardStorages_;