Changeset - 64536009a864
[Not reviewed]
0 4 0
HanzZ - 14 years ago 2011-04-10 19:38:42
hanzz.k@gmail.com
Store buddies in DB
4 files changed with 6 insertions and 3 deletions:
0 comments (0 inline, 0 general)
spectrum/src/sample.cfg
Show inline comments
 
@@ -2,7 +2,7 @@
 
jid = icq.localhost
 
password = secret
 
server = 127.0.0.1
 
port = 8888
 
port = 5222
 
protocol=prpl-jabber
 
server_mode=1
 

	
src/rosterstorage.cpp
Show inline comments
 
@@ -78,6 +78,7 @@ RosterStorage::RosterStorage(User *user, StorageBackend *storageBackend) {
 
	m_user = user;
 
	m_storageBackend = storageBackend;
 
	m_storageTimer = m_user->getComponent()->getFactories()->getTimerFactory()->createTimer(5000);
 
	m_storageTimer->onTick.connect(boost::bind(&RosterStorage::storeBuddies, this));
 
}
 

	
 
RosterStorage::~RosterStorage() {
src/user.cpp
Show inline comments
 
@@ -117,9 +117,9 @@ void User::handleDisconnected(const std::string &error) {
 
	msg->setTo(m_jid.toBare());
 
	msg->setFrom(m_component->getJID());
 
	m_component->getStanzaChannel()->sendMessage(msg);
 

	
 
	std::cout << "aaaaaa\n";
 
	if (m_component->inServerMode()) {
 
		dynamic_cast<Swift::ServerStanzaChannel *>(m_component->getStanzaChannel())->finishSession(m_jid, boost::shared_ptr<Swift::Element>(new Swift::StreamError()));
 
// 		dynamic_cast<Swift::ServerStanzaChannel *>(m_component->getStanzaChannel())->finishSession(m_jid, boost::shared_ptr<Swift::Element>(new Swift::StreamError()));
 
	}
 

	
 
	m_userManager->removeUser(this);
src/usermanager.cpp
Show inline comments
 
@@ -23,6 +23,7 @@
 
#include "transport/transport.h"
 
#include "transport/storagebackend.h"
 
#include "transport/conversationmanager.h"
 
#include "transport/rostermanager.h"
 

	
 
namespace Transport {
 

	
 
@@ -125,6 +126,7 @@ void UserManager::handlePresence(Swift::Presence::ref presence) {
 
// // 
 
// // 
 
				user = new User(presence->getFrom(), res, m_component, this);
 
				user->getRosterManager()->setStorageBackend(m_storageBackend);
 
				// TODO: handle features somehow
 
// // 			user->setFeatures(isVip ? CONFIG().VIPFeatures : CONFIG().transportFeatures);
 
// // // 				if (c != NULL)
0 comments (0 inline, 0 general)