summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Piekos <mateuszpiekos@gmail.com>2012-07-03 14:42:31 (GMT)
committerMateusz Piekos <mateuszpiekos@gmail.com>2012-07-03 14:42:31 (GMT)
commitfadd51fbed5111aba266a3b8b22be2c57ea11262 (patch)
tree2f63c78a4c30285c7a6a81c36677f4dd6e93c4af
parentad0276119802e8f2617a75f64e5f694b37c69bfe (diff)
downloadswift-contrib-fadd51fbed5111aba266a3b8b22be2c57ea11262.zip
swift-contrib-fadd51fbed5111aba266a3b8b22be2c57ea11262.tar.bz2
Modified statement about session request reject
-rw-r--r--Swift/Controllers/Chat/ChatsManager.cpp1
-rw-r--r--Swift/Controllers/UIInterfaces/ChatWindow.h2
-rw-r--r--Swift/QtUI/QtChatView.cpp2
-rw-r--r--Swiften/Whiteboard/OutgoingWhiteboardSession.cpp2
-rw-r--r--Swiften/Whiteboard/WhiteboardSession.h1
-rw-r--r--Swiften/Whiteboard/WhiteboardSessionManager.cpp6
-rw-r--r--Swiften/Whiteboard/WhiteboardSessionManager.h2
7 files changed, 14 insertions, 2 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp
index 616c0c6..4705246 100644
--- a/Swift/Controllers/Chat/ChatsManager.cpp
+++ b/Swift/Controllers/Chat/ChatsManager.cpp
@@ -113,6 +113,7 @@ ChatsManager::ChatsManager(
whiteboardSessionManager_->onSessionRequest.connect(boost::bind(&ChatsManager::handleWhiteboardSessionRequest, this, _1, _2));
whiteboardSessionManager_->onRequestAccepted.connect(boost::bind(&ChatsManager::handleWhiteboardStateChange, this, _1, ChatWindow::WhiteboardAccepted));
whiteboardSessionManager_->onSessionTerminate.connect(boost::bind(&ChatsManager::handleWhiteboardStateChange, this, _1, ChatWindow::WhiteboardCanceled));
+ whiteboardSessionManager_->onRequestRejected.connect(boost::bind(&ChatsManager::handleWhiteboardStateChange, this, _1, ChatWindow::WhiteboardRejected));
roster_->onJIDAdded.connect(boost::bind(&ChatsManager::handleJIDAddedToRoster, this, _1));
roster_->onJIDRemoved.connect(boost::bind(&ChatsManager::handleJIDRemovedFromRoster, this, _1));
roster_->onJIDUpdated.connect(boost::bind(&ChatsManager::handleJIDUpdatedInRoster, this, _1));
diff --git a/Swift/Controllers/UIInterfaces/ChatWindow.h b/Swift/Controllers/UIInterfaces/ChatWindow.h
index db9e322..86fb439 100644
--- a/Swift/Controllers/UIInterfaces/ChatWindow.h
+++ b/Swift/Controllers/UIInterfaces/ChatWindow.h
@@ -36,7 +36,7 @@ namespace Swift {
enum OccupantAction {Kick, Ban, MakeModerator, MakeParticipant, MakeVisitor, AddContact};
enum RoomAction {ChangeSubject, Configure, Affiliations, Destroy, Invite};
enum FileTransferState {WaitingForAccept, Negotiating, Transferring, Canceled, Finished, FTFailed};
- enum WhiteboardSessionState {WhiteboardAccepted, WhiteboardCanceled, WhiteboardTerminated};
+ enum WhiteboardSessionState {WhiteboardAccepted, WhiteboardCanceled, WhiteboardTerminated, WhiteboardRejected};
ChatWindow() {}
virtual ~ChatWindow() {};
diff --git a/Swift/QtUI/QtChatView.cpp b/Swift/QtUI/QtChatView.cpp
index d8c0df1..ef55dff 100644
--- a/Swift/QtUI/QtChatView.cpp
+++ b/Swift/QtUI/QtChatView.cpp
@@ -369,6 +369,8 @@ void QtChatView::setWhiteboardSessionStatus(QString id, const ChatWindow::Whiteb
QtChatWindow::buildChatWindowButton(tr("Show whitebaord"), QtChatWindow::ButtonWhiteboardShowWindow, id);
} else if (state == ChatWindow::WhiteboardCanceled) {
newInnerHTML = tr("Whiteboard session has been canceled");
+ } else if (state == ChatWindow::WhiteboardRejected) {
+ newInnerHTML = tr("Whiteboard session request has been rejected");
}
divElement.setInnerXml(newInnerHTML);
}
diff --git a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp
index 2de4ec4..f0b6d22 100644
--- a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp
+++ b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp
@@ -30,7 +30,7 @@ namespace Swift {
void OutgoingWhiteboardSession::handleRequestResponse(boost::shared_ptr<WhiteboardPayload> payload, ErrorPayload::ref error) {
if (error) {
- onSessionCancelled(toJID_);
+ onRequestRejected(toJID_);
}
}
}
diff --git a/Swiften/Whiteboard/WhiteboardSession.h b/Swiften/Whiteboard/WhiteboardSession.h
index d3e435a..0d10af3 100644
--- a/Swiften/Whiteboard/WhiteboardSession.h
+++ b/Swiften/Whiteboard/WhiteboardSession.h
@@ -36,6 +36,7 @@ namespace Swift {
boost::signal< void(const JID& contact)> onSessionTerminateReceived;
boost::signal< void(const JID& contact)> onRequestAccepted;
boost::signal< void(const JID& contact)> onSessionCancelled;
+ boost::signal< void(const JID& contact)> onRequestRejected;
protected:
JID toJID_;
diff --git a/Swiften/Whiteboard/WhiteboardSessionManager.cpp b/Swiften/Whiteboard/WhiteboardSessionManager.cpp
index 2e519e0..253febe 100644
--- a/Swiften/Whiteboard/WhiteboardSessionManager.cpp
+++ b/Swiften/Whiteboard/WhiteboardSessionManager.cpp
@@ -40,6 +40,7 @@ namespace Swift {
session->onSessionTerminateReceived.connect(boost::bind(&WhiteboardSessionManager::handleSessionTerminate, this, _1));
session->onSessionCancelled.connect(boost::bind(&WhiteboardSessionManager::handleSessionCancel, this, _1));
session->onRequestAccepted.connect(boost::bind(&WhiteboardSessionManager::handleSessionAccept, this, _1));
+ session->onRequestRejected.connect(boost::bind(&WhiteboardSessionManager::handleRequestReject, this, _1));
return session;
}
@@ -80,4 +81,9 @@ namespace Swift {
void WhiteboardSessionManager::handleSessionAccept(const JID& contact) {
onRequestAccepted(contact);
}
+
+ void WhiteboardSessionManager::handleRequestReject(const JID& contact) {
+ sessions_.erase(contact.toBare());
+ onRequestRejected(contact);
+ }
}
diff --git a/Swiften/Whiteboard/WhiteboardSessionManager.h b/Swiften/Whiteboard/WhiteboardSessionManager.h
index 10f27d5..9711e5b 100644
--- a/Swiften/Whiteboard/WhiteboardSessionManager.h
+++ b/Swiften/Whiteboard/WhiteboardSessionManager.h
@@ -32,6 +32,7 @@ namespace Swift {
boost::signal< void (const JID&, bool senderIsSelf)> onSessionRequest;
boost::signal< void (const JID&)> onSessionTerminate;
boost::signal< void (const JID&)> onRequestAccepted;
+ boost::signal< void (const JID&)> onRequestRejected;
private:
JID getFullJID(const JID& bareJID);
@@ -40,6 +41,7 @@ namespace Swift {
void handleSessionTerminate(const JID& contact);
void handleSessionCancel(const JID& contact);
void handleSessionAccept(const JID& contact);
+ void handleRequestReject(const JID& contact);
private:
std::map<JID, boost::shared_ptr<WhiteboardSession> > sessions_;