diff options
Diffstat (limited to 'Swift/Controllers/Chat/ChatController.cpp')
| -rw-r--r-- | Swift/Controllers/Chat/ChatController.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Swift/Controllers/Chat/ChatController.cpp b/Swift/Controllers/Chat/ChatController.cpp index fe8e870..a8ffaf4 100644 --- a/Swift/Controllers/Chat/ChatController.cpp +++ b/Swift/Controllers/Chat/ChatController.cpp | |||
| @@ -86,7 +86,7 @@ ChatController::ChatController(const JID& self, StanzaChannel* stanzaChannel, IQ | |||
| 86 | chatStateNotifier_->setContactIsOnline(theirPresence && theirPresence->getType() == Presence::Available); | 86 | chatStateNotifier_->setContactIsOnline(theirPresence && theirPresence->getType() == Presence::Available); |
| 87 | startMessage += "."; | 87 | startMessage += "."; |
| 88 | chatWindow_->addSystemMessage(chatMessageParser_->parseMessageBody(startMessage), ChatWindow::DefaultDirection); | 88 | chatWindow_->addSystemMessage(chatMessageParser_->parseMessageBody(startMessage), ChatWindow::DefaultDirection); |
| 89 | chatWindow_->onContinuationsBroken.connect([this, startMessage]() { chatWindow_->addSystemMessage(chatMessageParser_->parseMessageBody(startMessage), ChatWindow::DefaultDirection); }); | 89 | continuationsBrokenConnection_ = chatWindow_->onContinuationsBroken.connect([this, startMessage]() { chatWindow_->addSystemMessage(chatMessageParser_->parseMessageBody(startMessage), ChatWindow::DefaultDirection); }); |
| 90 | chatWindow_->onUserTyping.connect(boost::bind(&ChatStateNotifier::setUserIsTyping, chatStateNotifier_)); | 90 | chatWindow_->onUserTyping.connect(boost::bind(&ChatStateNotifier::setUserIsTyping, chatStateNotifier_)); |
| 91 | chatWindow_->onUserCancelsTyping.connect(boost::bind(&ChatStateNotifier::userCancelledNewMessage, chatStateNotifier_)); | 91 | chatWindow_->onUserCancelsTyping.connect(boost::bind(&ChatStateNotifier::userCancelledNewMessage, chatStateNotifier_)); |
| 92 | chatWindow_->onFileTransferStart.connect(boost::bind(&ChatController::handleFileTransferStart, this, _1, _2)); | 92 | chatWindow_->onFileTransferStart.connect(boost::bind(&ChatController::handleFileTransferStart, this, _1, _2)); |
| @@ -585,8 +585,20 @@ JID ChatController::messageCorrectionJID(const JID& fromJID) { | |||
| 585 | } | 585 | } |
| 586 | 586 | ||
| 587 | ChatWindow* ChatController::detachChatWindow() { | 587 | ChatWindow* ChatController::detachChatWindow() { |
| 588 | chatWindow_->onUserTyping.disconnect(boost::bind(&ChatStateNotifier::setUserIsTyping, chatStateNotifier_)); | 588 | continuationsBrokenConnection_.disconnect(); |
| 589 | chatWindow_->onClosed.disconnect(boost::bind(&ChatController::handleWindowClosed, this)); | ||
| 590 | chatWindow_->onInviteToChat.disconnect(boost::bind(&ChatController::handleInviteToChat, this, _1)); | ||
| 591 | chatWindow_->onUnblockUserRequest.disconnect(boost::bind(&ChatController::handleUnblockUserRequest, this)); | ||
| 592 | chatWindow_->onBlockUserRequest.disconnect(boost::bind(&ChatController::handleBlockUserRequest, this)); | ||
| 593 | chatWindow_->onWhiteboardWindowShow.disconnect(boost::bind(&ChatController::handleWhiteboardWindowShow, this)); | ||
| 594 | chatWindow_->onWhiteboardSessionCancel.disconnect(boost::bind(&ChatController::handleWhiteboardSessionCancel, this)); | ||
| 595 | chatWindow_->onWhiteboardSessionAccept.disconnect(boost::bind(&ChatController::handleWhiteboardSessionAccept, this)); | ||
| 596 | chatWindow_->onSendFileRequest.disconnect(boost::bind(&ChatController::handleSendFileRequest, this, _1)); | ||
| 597 | chatWindow_->onFileTransferCancel.disconnect(boost::bind(&ChatController::handleFileTransferCancel, this, _1)); | ||
| 598 | chatWindow_->onFileTransferAccept.disconnect(boost::bind(&ChatController::handleFileTransferAccept, this, _1, _2)); | ||
| 599 | chatWindow_->onFileTransferStart.disconnect(boost::bind(&ChatController::handleFileTransferStart, this, _1, _2)); | ||
| 589 | chatWindow_->onUserCancelsTyping.disconnect(boost::bind(&ChatStateNotifier::userCancelledNewMessage, chatStateNotifier_)); | 600 | chatWindow_->onUserCancelsTyping.disconnect(boost::bind(&ChatStateNotifier::userCancelledNewMessage, chatStateNotifier_)); |
| 601 | chatWindow_->onUserTyping.disconnect(boost::bind(&ChatStateNotifier::setUserIsTyping, chatStateNotifier_)); | ||
| 590 | return ChatControllerBase::detachChatWindow(); | 602 | return ChatControllerBase::detachChatWindow(); |
| 591 | } | 603 | } |
| 592 | 604 | ||
Swift