diff options
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/Controllers/MainController.cpp | 1 | ||||
-rw-r--r-- | Swift/Controllers/Roster/ContactRosterItem.h | 1 | ||||
-rw-r--r-- | Swift/Controllers/Roster/RosterController.cpp | 3 | ||||
-rw-r--r-- | Swift/QtUI/Roster/QtRosterWidget.cpp | 7 |
4 files changed, 10 insertions, 2 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index e866102..e67df62 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -314,6 +314,7 @@ void MainController::handleConnected() { discoInfo.addFeature(DiscoInfo::JingleTransportsS5BFeature); #endif discoInfo.addFeature(DiscoInfo::MessageDeliveryReceiptsFeature); + discoInfo.addFeature(DiscoInfo::WhiteboardFeature); client_->getDiscoManager()->setCapsNode(CLIENT_NODE); client_->getDiscoManager()->setDiscoInfo(discoInfo); diff --git a/Swift/Controllers/Roster/ContactRosterItem.h b/Swift/Controllers/Roster/ContactRosterItem.h index 9932dc4..8389a44 100644 --- a/Swift/Controllers/Roster/ContactRosterItem.h +++ b/Swift/Controllers/Roster/ContactRosterItem.h @@ -25,6 +25,7 @@ class ContactRosterItem : public RosterItem { public: enum Feature { FileTransferFeature, + WhiteboardFeature, }; public: diff --git a/Swift/Controllers/Roster/RosterController.cpp b/Swift/Controllers/Roster/RosterController.cpp index 170bfd0..ec52993 100644 --- a/Swift/Controllers/Roster/RosterController.cpp +++ b/Swift/Controllers/Roster/RosterController.cpp @@ -321,6 +321,9 @@ void RosterController::handleOnCapsChanged(const JID& jid) { if (info->hasFeature(DiscoInfo::JingleFeature) && info->hasFeature(DiscoInfo::JingleFTFeature) && info->hasFeature(DiscoInfo::JingleTransportsIBBFeature)) { features.insert(ContactRosterItem::FileTransferFeature); } + if (info->hasFeature(DiscoInfo::WhiteboardFeature)) { + features.insert(ContactRosterItem::WhiteboardFeature); + } roster_->setAvailableFeatures(jid, features); } } diff --git a/Swift/QtUI/Roster/QtRosterWidget.cpp b/Swift/QtUI/Roster/QtRosterWidget.cpp index a7767fe..7149f6a 100644 --- a/Swift/QtUI/Roster/QtRosterWidget.cpp +++ b/Swift/QtUI/Roster/QtRosterWidget.cpp @@ -63,7 +63,10 @@ void QtRosterWidget::contextMenuEvent(QContextMenuEvent* event) { sendFile = contextMenu.addAction(tr("Send File")); } #endif - QAction* startWhiteboardChat = contextMenu.addAction(tr("Start Whiteboard Chat")); + QAction* startWhiteboardChat = NULL; + if (contact->supportsFeature(ContactRosterItem::WhiteboardFeature)) { + startWhiteboardChat = contextMenu.addAction(tr("Start Whiteboard Chat")); + } QAction* result = contextMenu.exec(event->globalPos()); if (result == editContact) { eventStream_->send(boost::make_shared<RequestContactEditorUIEvent>(contact->getJID())); @@ -81,7 +84,7 @@ void QtRosterWidget::contextMenuEvent(QContextMenuEvent* event) { } } #endif - else if (result == startWhiteboardChat) { + else if (startWhiteboardChat && result == startWhiteboardChat) { eventStream_->send(boost::make_shared<RequestWhiteboardUIEvent>(contact->getJID())); } } |