diff --git a/src/transport.cpp b/src/transport.cpp index 3c15d24e488c12960959934e5dc9c3dc4b4aab77..7123482d55fa16637bce67a86bcade0f907c2493 100644 --- a/src/transport.cpp +++ b/src/transport.cpp @@ -28,24 +28,19 @@ using namespace boost; namespace Transport { -Component::Component(Swift::EventLoop *loop, Config::Variables &config) { +Component::Component(Swift::EventLoop *loop, Config *config) { m_reconnectCount = 0; m_config = config; m_storageBackend = NULL; - for (Config::Variables::iterator i = config.begin() ; i != config.end() ; ++i ) - { - std::cout << (*i).first << "\n"; - } - - m_jid = Swift::JID(m_config["service.jid"].as()); + m_jid = Swift::JID(CONFIG_STRING(m_config, "service.jid")); m_factories = new BoostNetworkFactories(loop); m_reconnectTimer = m_factories->getTimerFactory()->createTimer(1000); m_reconnectTimer->onTick.connect(bind(&Component::connect, this)); - m_component = new Swift::Component(loop, m_factories, m_jid, m_config["service.password"].as()); + m_component = new Swift::Component(loop, m_factories, m_jid, CONFIG_STRING(m_config, "service.password")); m_component->setSoftwareVersion("", ""); m_component->onConnected.connect(bind(&Component::handleConnected, this)); m_component->onError.connect(bind(&Component::handleConnectionError, this, _1)); @@ -95,7 +90,7 @@ void Component::setBuddyFeatures(std::list &features) { void Component::connect() { m_reconnectCount++; - m_component->connect(m_config["service.server"].as(), m_config["service.port"].as()); + m_component->connect(CONFIG_STRING(m_config, "service.server"), CONFIG_INT(m_config, "service.port")); m_reconnectTimer->stop(); }