diff --git a/src/networkpluginserver.cpp b/src/networkpluginserver.cpp index eeae4c314298b3904ed6de13d71f14c9fef66200..a36699be69bcc86f3a6c94e38d2ec9cb2f0359c7 100644 --- a/src/networkpluginserver.cpp +++ b/src/networkpluginserver.cpp @@ -95,7 +95,12 @@ class NetworkFactory : public Factory { LocalBuddy *buddy = new LocalBuddy(rosterManager, buddyInfo.id); buddy->setAlias(buddyInfo.alias); buddy->setName(buddyInfo.legacyName); - buddy->setSubscription(buddyInfo.subscription); + if (buddyInfo.subscription == "both") { + buddy->setSubscription(Buddy::Both); + } + else { + buddy->setSubscription(Buddy::Ask); + } buddy->setGroups(buddyInfo.groups); buddy->setFlags((BuddyFlag) (buddyInfo.flags)); if (buddyInfo.settings.find("icon_hash") != buddyInfo.settings.end()) @@ -339,15 +344,19 @@ void NetworkPluginServer::handleNewClientConnection(boost::shared_ptrgetJID().toString()); + LOG4CXX_ERROR(logger, "Backend " << c << " (ID=" << c->id << ") disconnected (probably crashed) with active user " << (*it)->getJID().toString()); (*it)->setData(NULL); (*it)->handleDisconnected("Internal Server Error, please reconnect."); } @@ -570,6 +579,7 @@ void NetworkPluginServer::handleConvMessagePayload(const std::string &data, bool // Forward it conv->handleMessage(msg, payload.nickname()); + m_userManager->messageToXMPPSent(); } void NetworkPluginServer::handleAttentionPayload(const std::string &data) { @@ -607,6 +617,7 @@ void NetworkPluginServer::handleStatsPayload(Backend *c, const std::string &data c->res = payload.res(); c->init_res = payload.init_res(); c->shared = payload.shared(); + c->id = payload.id(); } void NetworkPluginServer::handleFTStartPayload(const std::string &data) { @@ -853,12 +864,12 @@ void NetworkPluginServer::pingTimeout() { sendPing((*it)); } else { - LOG4CXX_INFO(logger, "Disconnecting backend " << (*it) << ". PING response not received."); + LOG4CXX_INFO(logger, "Disconnecting backend " << (*it) << " (ID=" << (*it)->id << "). PING response not received."); toRemove.push_back(*it); } if ((*it)->users.size() == 0) { - LOG4CXX_INFO(logger, "Disconnecting backend " << (*it) << ". There are no users."); + LOG4CXX_INFO(logger, "Disconnecting backend " << (*it) << " (ID=" << (*it)->id << "). There are no users."); toRemove.push_back(*it); } } @@ -887,7 +898,7 @@ void NetworkPluginServer::collectBackend() { if (m_collectTimer) { m_collectTimer->start(); } - LOG4CXX_INFO(logger, "Backend " << backend << "is set to die"); + LOG4CXX_INFO(logger, "Backend " << backend << " (ID=" << backend->id << ") is set to die"); backend->acceptUsers = false; } } @@ -1355,7 +1366,7 @@ void NetworkPluginServer::sendPing(Backend *c) { wrap.SerializeToString(&message); if (c->connection) { - LOG4CXX_INFO(logger, "PING to " << c); + LOG4CXX_INFO(logger, "PING to " << c << " (ID=" << c->id << ")"); send(c->connection, message); c->pongReceived = false; }