From fb7437ec7e71407f1f6a44522be2f6f7c3792d05 Mon Sep 17 00:00:00 2001 From: Edwin Mons Date: Tue, 19 Nov 2013 18:46:03 +0100 Subject: Sluift: fix debug output for BOSH connections Change-Id: I0bf798200e5e74e682eeab688f3ae79e49c73ed2 diff --git a/Sluift/SluiftClient.cpp b/Sluift/SluiftClient.cpp index bfae621..184fbd6 100644 --- a/Sluift/SluiftClient.cpp +++ b/Sluift/SluiftClient.cpp @@ -36,9 +36,6 @@ SluiftClient::SluiftClient( client->onPresenceReceived.connect(boost::bind(&SluiftClient::handleIncomingPresence, this, _1)); client->getPubSubManager()->onEvent.connect(boost::bind(&SluiftClient::handleIncomingPubSubEvent, this, _1, _2)); client->getRoster()->onInitialRosterPopulated.connect(boost::bind(&SluiftClient::handleInitialRosterPopulated, this)); - if (globals->debug) { - tracer = new ClientXMLTracer(client); - } } SluiftClient::~SluiftClient() { @@ -49,6 +46,9 @@ SluiftClient::~SluiftClient() { void SluiftClient::connect() { rosterReceived = false; disconnectedError = boost::optional(); + if (globals->debug) { + tracer = new ClientXMLTracer(client, options.boshURL.isEmpty()? false: true); + } client->connect(options); } @@ -56,6 +56,9 @@ void SluiftClient::connect(const std::string& host, int port) { rosterReceived = false; options.manualHostname = host; options.manualPort = port; + if (globals->debug) { + tracer = new ClientXMLTracer(client, options.boshURL.isEmpty()? false: true); + } client->connect(options); } -- cgit v0.10.2-6-g49f6