Changeset - 6ac59201016e
[Not reviewed]
0 1 0
HanzZ - 14 years ago 2011-05-21 09:56:47
hanzz.k@gmail.com
Destroy all conversations when user logout
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/conversationmanager.cpp
Show inline comments
 
@@ -27,24 +27,27 @@
 
#include "Swiften/Roster/SetRosterRequest.h"
 
#include "Swiften/Elements/RosterPayload.h"
 
#include "Swiften/Elements/RosterItemPayload.h"
 

	
 
namespace Transport {
 

	
 
ConversationManager::ConversationManager(User *user, Component *component){
 
	m_user = user;
 
	m_component = component;
 
}
 

	
 
ConversationManager::~ConversationManager() {
 
	while(!m_convs.empty()) {
 
		delete (*m_convs.begin()).second;
 
	}
 
}
 

	
 
void ConversationManager::setConversation(Conversation *conv) {
 
	m_convs[conv->getLegacyName()] = conv;
 
}
 

	
 
void ConversationManager::unsetConversation(Conversation *conv) {
 
	for (std::map<std::string, Conversation *>::const_iterator it = m_convs.begin(); it != m_convs.end(); it++) {
 
		if ((*it).second->getRoom() == conv->getLegacyName()) {
 
			(*it).second->setRoom("");
 
		}
 
	}
0 comments (0 inline, 0 general)