From f0f819b4fd95fd7549ba43d7beb174e76012e920 Mon Sep 17 00:00:00 2001 From: HanzZ Date: Sun, 12 Jun 2011 19:25:51 +0200 Subject: [PATCH] Fixed users_per_backend --- spectrum/src/sample.cfg | 4 ++-- src/conversation.cpp | 1 - src/networkpluginserver.cpp | 4 +++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spectrum/src/sample.cfg b/spectrum/src/sample.cfg index 4f85c132..532a33f0 100644 --- a/spectrum/src/sample.cfg +++ b/spectrum/src/sample.cfg @@ -9,8 +9,8 @@ backend_port=10001 users_per_backend=2 backend=../../backends/libpurple/libpurple_backend #backend=../../backends/libircclient-qt/libircclient-qt_backend -protocol=prpl-jabber -#protocol=prpl-msn +#protocol=prpl-jabber +protocol=prpl-msn #protocol=prpl-icq [database] diff --git a/src/conversation.cpp b/src/conversation.cpp index e2cd5112..524afdb4 100644 --- a/src/conversation.cpp +++ b/src/conversation.cpp @@ -36,7 +36,6 @@ Conversation::Conversation(ConversationManager *conversationManager, const std:: } Conversation::~Conversation() { - m_conversationManager->removeConversation(this); } void Conversation::handleMessage(boost::shared_ptr &message, const std::string &nickname) { diff --git a/src/networkpluginserver.cpp b/src/networkpluginserver.cpp index ec4edf96..88cf6d2d 100644 --- a/src/networkpluginserver.cpp +++ b/src/networkpluginserver.cpp @@ -172,7 +172,7 @@ void NetworkPluginServer::handleSessionFinished(Client *c) { // Execute new session only if there's no free one after this crash/disconnection for (std::list::const_iterator it = m_clients.begin(); it != m_clients.end(); it++) { - if ((*it)->users.size() < 1) { + if ((*it)->users.size() < CONFIG_INT(m_config, "service.users_per_backend")) { return; } } @@ -530,6 +530,8 @@ void NetworkPluginServer::handleRoomLeft(User *user, const std::string &r) { return; } + user->getConversationManager()->removeConversation(conv); + delete conv; }