summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/Chat')
-rw-r--r--Swift/Controllers/Chat/ChatController.cpp12
-rw-r--r--Swift/Controllers/Chat/ChatsManager.cpp12
-rw-r--r--Swift/Controllers/Chat/MUCSearchController.cpp12
3 files changed, 18 insertions, 18 deletions
diff --git a/Swift/Controllers/Chat/ChatController.cpp b/Swift/Controllers/Chat/ChatController.cpp
index 5f441f8..debd83f 100644
--- a/Swift/Controllers/Chat/ChatController.cpp
+++ b/Swift/Controllers/Chat/ChatController.cpp
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2010-2018 Isode Limited. 2 * Copyright (c) 2010-2019 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
@@ -190,7 +190,7 @@ void ChatController::preHandleIncomingMessage(std::shared_ptr<MessageEvent> mess
190 // handle XEP-0184 Message Receipts 190 // handle XEP-0184 Message Receipts
191 // incomming receipts 191 // incomming receipts
192 if (std::shared_ptr<DeliveryReceipt> receipt = message->getPayload<DeliveryReceipt>()) { 192 if (std::shared_ptr<DeliveryReceipt> receipt = message->getPayload<DeliveryReceipt>()) {
193 SWIFT_LOG(debug) << "received receipt for id: " << receipt->getReceivedID() << std::endl; 193 SWIFT_LOG(debug) << "received receipt for id: " << receipt->getReceivedID();
194 if (requestedReceipts_.find(receipt->getReceivedID()) != requestedReceipts_.end()) { 194 if (requestedReceipts_.find(receipt->getReceivedID()) != requestedReceipts_.end()) {
195 chatWindow_->setMessageReceiptState(requestedReceipts_[receipt->getReceivedID()], ChatWindow::ReceiptReceived); 195 chatWindow_->setMessageReceiptState(requestedReceipts_[receipt->getReceivedID()], ChatWindow::ReceiptReceived);
196 requestedReceipts_.erase(receipt->getReceivedID()); 196 requestedReceipts_.erase(receipt->getReceivedID());
@@ -407,7 +407,7 @@ void ChatController::handleWhiteboardStateChange(const ChatWindow::WhiteboardSes
407} 407}
408 408
409void ChatController::handleFileTransferCancel(std::string id) { 409void ChatController::handleFileTransferCancel(std::string id) {
410 SWIFT_LOG(debug) << "handleFileTransferCancel(" << id << ")" << std::endl; 410 SWIFT_LOG(debug) << "handleFileTransferCancel(" << id << ")";
411 if (ftControllers.find(id) != ftControllers.end()) { 411 if (ftControllers.find(id) != ftControllers.end()) {
412 ftControllers[id]->cancel(); 412 ftControllers[id]->cancel();
413 } else { 413 } else {
@@ -416,7 +416,7 @@ void ChatController::handleFileTransferCancel(std::string id) {
416} 416}
417 417
418void ChatController::handleFileTransferStart(std::string id, std::string description) { 418void ChatController::handleFileTransferStart(std::string id, std::string description) {
419 SWIFT_LOG(debug) << "handleFileTransferStart(" << id << ", " << description << ")" << std::endl; 419 SWIFT_LOG(debug) << "handleFileTransferStart(" << id << ", " << description << ")";
420 if (ftControllers.find(id) != ftControllers.end()) { 420 if (ftControllers.find(id) != ftControllers.end()) {
421 ftControllers[id]->start(description); 421 ftControllers[id]->start(description);
422 } else { 422 } else {
@@ -425,7 +425,7 @@ void ChatController::handleFileTransferStart(std::string id, std::string descrip
425} 425}
426 426
427void ChatController::handleFileTransferAccept(std::string id, std::string filename) { 427void ChatController::handleFileTransferAccept(std::string id, std::string filename) {
428 SWIFT_LOG(debug) << "handleFileTransferAccept(" << id << ", " << filename << ")" << std::endl; 428 SWIFT_LOG(debug) << "handleFileTransferAccept(" << id << ", " << filename << ")";
429 if (ftControllers.find(id) != ftControllers.end()) { 429 if (ftControllers.find(id) != ftControllers.end()) {
430 ftControllers[id]->accept(filename); 430 ftControllers[id]->accept(filename);
431 } else { 431 } else {
@@ -434,7 +434,7 @@ void ChatController::handleFileTransferAccept(std::string id, std::string filena
434} 434}
435 435
436void ChatController::handleSendFileRequest(std::string filename) { 436void ChatController::handleSendFileRequest(std::string filename) {
437 SWIFT_LOG(debug) << "ChatController::handleSendFileRequest(" << filename << ")" << std::endl; 437 SWIFT_LOG(debug) << "ChatController::handleSendFileRequest(" << filename << ")";
438 eventStream_->send(std::make_shared<SendFileUIEvent>(getToJID(), filename)); 438 eventStream_->send(std::make_shared<SendFileUIEvent>(getToJID(), filename));
439} 439}
440 440
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp
index 6530a7e..193af7f 100644
--- a/Swift/Controllers/Chat/ChatsManager.cpp
+++ b/Swift/Controllers/Chat/ChatsManager.cpp
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2010-2018 Isode Limited. 2 * Copyright (c) 2010-2019 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
@@ -175,7 +175,7 @@ ChatsManager::~ChatsManager() {
175 roster_->onRosterCleared.disconnect(boost::bind(&ChatsManager::handleRosterCleared, this)); 175 roster_->onRosterCleared.disconnect(boost::bind(&ChatsManager::handleRosterCleared, this));
176 ftOverview_->onNewFileTransferController.disconnect(boost::bind(&ChatsManager::handleNewFileTransferController, this, _1)); 176 ftOverview_->onNewFileTransferController.disconnect(boost::bind(&ChatsManager::handleNewFileTransferController, this, _1));
177 delete joinMUCWindow_; 177 delete joinMUCWindow_;
178 SWIFT_LOG(debug) << "Destroying ChatsManager, containing " << chatControllers_.size() << " chats and " << mucControllers_.size() << " MUCs" << std::endl; 178 SWIFT_LOG(debug) << "Destroying ChatsManager, containing " << chatControllers_.size() << " chats and " << mucControllers_.size() << " MUCs";
179 for (JIDChatControllerPair controllerPair : chatControllers_) { 179 for (JIDChatControllerPair controllerPair : chatControllers_) {
180 delete controllerPair.second; 180 delete controllerPair.second;
181 } 181 }
@@ -311,7 +311,7 @@ void ChatsManager::loadRecents() {
311 boost::archive::text_iarchive ia(deserializeStream); 311 boost::archive::text_iarchive ia(deserializeStream);
312 ia >> recentChats; 312 ia >> recentChats;
313 } catch (const boost::archive::archive_exception& e) { 313 } catch (const boost::archive::archive_exception& e) {
314 SWIFT_LOG(debug) << "Failed to load recents: " << e.what() << std::endl; 314 SWIFT_LOG(debug) << "Failed to load recents: " << e.what();
315 return; 315 return;
316 } 316 }
317 recentChats.erase(std::remove(recentChats.begin(), recentChats.end(), ChatListWindow::Chat()), recentChats.end()); 317 recentChats.erase(std::remove(recentChats.begin(), recentChats.end(), ChatListWindow::Chat()), recentChats.end());
@@ -936,7 +936,7 @@ void ChatsManager::handleUserNicknameChanged(MUCController* mucController, const
936 JID oldMUCChatJID = mucController->getToJID().withResource(oldNickname); 936 JID oldMUCChatJID = mucController->getToJID().withResource(oldNickname);
937 JID newMUCChatJID = mucController->getToJID().withResource(newNickname); 937 JID newMUCChatJID = mucController->getToJID().withResource(newNickname);
938 938
939 SWIFT_LOG(debug) << "nickname change in " << mucController->getToJID().toString() << " from " << oldNickname << " to " << newNickname << std::endl; 939 SWIFT_LOG(debug) << "nickname change in " << mucController->getToJID().toString() << " from " << oldNickname << " to " << newNickname;
940 940
941 // get current chat controller 941 // get current chat controller
942 ChatController *chatController = getChatControllerIfExists(oldMUCChatJID); 942 ChatController *chatController = getChatControllerIfExists(oldMUCChatJID);
@@ -983,7 +983,7 @@ void ChatsManager::handleIncomingMessage(std::shared_ptr<Message> incomingMessag
983 controller->handleIncomingOwnMessage(forwardedMessage); 983 controller->handleIncomingOwnMessage(forwardedMessage);
984 } 984 }
985 else { 985 else {
986 SWIFT_LOG(error) << "Carbons message ignored." << std::endl; 986 SWIFT_LOG(error) << "Carbons message ignored.";
987 } 987 }
988 return; 988 return;
989 } 989 }
@@ -1141,7 +1141,7 @@ void ChatsManager::handleLocalServiceFound(const JID& service, std::shared_ptr<D
1141 && identity.getType() == "text")) { 1141 && identity.getType() == "text")) {
1142 localMUCServiceJID_ = service; 1142 localMUCServiceJID_ = service;
1143 localMUCServiceFinderWalker_->endWalk(); 1143 localMUCServiceFinderWalker_->endWalk();
1144 SWIFT_LOG(debug) << "Use following MUC service for impromptu chats: " << localMUCServiceJID_ << std::endl; 1144 SWIFT_LOG(debug) << "Use following MUC service for impromptu chats: " << localMUCServiceJID_;
1145 break; 1145 break;
1146 } 1146 }
1147 } 1147 }
diff --git a/Swift/Controllers/Chat/MUCSearchController.cpp b/Swift/Controllers/Chat/MUCSearchController.cpp
index 5db917a..0b54d25 100644
--- a/Swift/Controllers/Chat/MUCSearchController.cpp
+++ b/Swift/Controllers/Chat/MUCSearchController.cpp
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2010-2016 Isode Limited. 2 * Copyright (c) 2010-2019 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
@@ -92,7 +92,7 @@ void MUCSearchController::handleSearchService(const JID& jid) {
92 delete walker_; 92 delete walker_;
93 } 93 }
94 94
95 SWIFT_LOG(debug) << "Starting walking MUC services" << std::endl; 95 SWIFT_LOG(debug) << "Starting walking MUC services";
96 itemsInProgress_ = 0; 96 itemsInProgress_ = 0;
97 walker_ = new DiscoServiceWalker(jid, iqRouter_); 97 walker_ = new DiscoServiceWalker(jid, iqRouter_);
98 walker_->onServiceFound.connect(boost::bind(&MUCSearchController::handleDiscoServiceFound, this, _1, _2)); 98 walker_->onServiceFound.connect(boost::bind(&MUCSearchController::handleDiscoServiceFound, this, _1, _2));
@@ -113,14 +113,14 @@ void MUCSearchController::handleDiscoServiceFound(const JID& jid, std::shared_pt
113 } 113 }
114 } 114 }
115 if (isMUC) { 115 if (isMUC) {
116 SWIFT_LOG(debug) << "MUC Service found: " << jid << std::endl; 116 SWIFT_LOG(debug) << "MUC Service found: " << jid;
117 services_.erase(std::remove(services_.begin(), services_.end(), jid), services_.end()); 117 services_.erase(std::remove(services_.begin(), services_.end(), jid), services_.end());
118 services_.push_back(jid); 118 services_.push_back(jid);
119 serviceDetails_[jid].setName(name); 119 serviceDetails_[jid].setName(name);
120 serviceDetails_[jid].setJID(jid); 120 serviceDetails_[jid].setJID(jid);
121 serviceDetails_[jid].setComplete(false); 121 serviceDetails_[jid].setComplete(false);
122 itemsInProgress_++; 122 itemsInProgress_++;
123 SWIFT_LOG(debug) << "Requesting items of " << jid << " (" << itemsInProgress_ << " item requests in progress)" << std::endl; 123 SWIFT_LOG(debug) << "Requesting items of " << jid << " (" << itemsInProgress_ << " item requests in progress)";
124 GetDiscoItemsRequest::ref discoItemsRequest = GetDiscoItemsRequest::create(jid, iqRouter_); 124 GetDiscoItemsRequest::ref discoItemsRequest = GetDiscoItemsRequest::create(jid, iqRouter_);
125 discoItemsRequest->onResponse.connect(boost::bind(&MUCSearchController::handleRoomsItemsResponse, this, _1, _2, jid)); 125 discoItemsRequest->onResponse.connect(boost::bind(&MUCSearchController::handleRoomsItemsResponse, this, _1, _2, jid));
126 discoItemsRequest->send(); 126 discoItemsRequest->send();
@@ -132,7 +132,7 @@ void MUCSearchController::handleDiscoServiceFound(const JID& jid, std::shared_pt
132} 132}
133 133
134void MUCSearchController::handleDiscoWalkFinished() { 134void MUCSearchController::handleDiscoWalkFinished() {
135 SWIFT_LOG(debug) << "MUC Walk finished" << std::endl; 135 SWIFT_LOG(debug) << "MUC Walk finished";
136 updateInProgressness(); 136 updateInProgressness();
137} 137}
138 138
@@ -144,7 +144,7 @@ void MUCSearchController::removeService(const JID& jid) {
144 144
145void MUCSearchController::handleRoomsItemsResponse(std::shared_ptr<DiscoItems> items, ErrorPayload::ref error, const JID& jid) { 145void MUCSearchController::handleRoomsItemsResponse(std::shared_ptr<DiscoItems> items, ErrorPayload::ref error, const JID& jid) {
146 itemsInProgress_--; 146 itemsInProgress_--;
147 SWIFT_LOG(debug) << "Items received for " << jid << " (" << itemsInProgress_ << " item requests in progress)" << std::endl; 147 SWIFT_LOG(debug) << "Items received for " << jid << " (" << itemsInProgress_ << " item requests in progress)";
148 updateInProgressness(); 148 updateInProgressness();
149 if (error) { 149 if (error) {
150 handleDiscoError(jid, error); 150 handleDiscoError(jid, error);