diff options
| author | Kevin Smith <git@kismith.co.uk> | 2010-06-01 21:05:42 (GMT) | 
|---|---|---|
| committer | Kevin Smith <git@kismith.co.uk> | 2010-06-01 21:05:42 (GMT) | 
| commit | b898f9f8c9c8dd6650e6c635276eeeb44d9c0144 (patch) | |
| tree | 2d7f98e6274b3f7a46822cd070c57f2579c8f716 | |
| parent | 52d670e643a8c6b22f312e376898b9b8bec75984 (diff) | |
| download | swift-b898f9f8c9c8dd6650e6c635276eeeb44d9c0144.zip swift-b898f9f8c9c8dd6650e6c635276eeeb44d9c0144.tar.bz2 | |
Don't try and send messages with labels until we've got a valid catalogue.
Resolves: #432
| -rw-r--r-- | Swift/Controllers/Chat/ChatControllerBase.cpp | 8 | 
1 files changed, 5 insertions, 3 deletions
| diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp index 5f27efb..d1452c7 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.cpp +++ b/Swift/Controllers/Chat/ChatControllerBase.cpp @@ -39,12 +39,12 @@ void ChatControllerBase::setEnabled(bool enabled) {  void ChatControllerBase::setAvailableServerFeatures(boost::shared_ptr<DiscoInfo> info) {  	if (iqRouter_->isAvailable() && info->hasFeature(DiscoInfo::SecurityLabels)) { -		chatWindow_->setSecurityLabelsEnabled(true); -		chatWindow_->setSecurityLabelsError(); +		//chatWindow_->setSecurityLabelsEnabled(true); +		//chatWindow_->setSecurityLabelsError();  		boost::shared_ptr<GetSecurityLabelsCatalogRequest> request(new GetSecurityLabelsCatalogRequest(JID(toJID_.toBare()), iqRouter_));  		request->onResponse.connect(boost::bind(&ChatControllerBase::handleSecurityLabelsCatalogResponse, this, _1, _2));  		request->send(); -		labelsEnabled_ = true; +		//labelsEnabled_ = true;  	} else {  		chatWindow_->setSecurityLabelsEnabled(false);  		labelsEnabled_ = false; @@ -87,10 +87,12 @@ void ChatControllerBase::handleSecurityLabelsCatalogResponse(boost::shared_ptr<S  			chatWindow_->setSecurityLabelsEnabled(false);  			labelsEnabled_ = false;  		} else { +			labelsEnabled_ = true;  			chatWindow_->setAvailableSecurityLabels(catalog->getLabels());  			chatWindow_->setSecurityLabelsEnabled(true);  		}  	} else { +		labelsEnabled_ = false;  		chatWindow_->setSecurityLabelsError();  	}  } | 
 Swift
 Swift