diff --git a/protocols/xmpp/JabberHandler.cpp b/protocols/xmpp/JabberHandler.cpp index dd081e5..6c1891d 100644 --- a/protocols/xmpp/JabberHandler.cpp +++ b/protocols/xmpp/JabberHandler.cpp @@ -8,6 +8,8 @@ * Jaidyn Levesque, jadedctrl@teknik.io */ +#include + #include #include #include @@ -401,7 +403,7 @@ JabberHandler::UpdateSettings(BMessage* msg) fJid.setJID(jid.String()); // Register our client - fClient = new gloox::Client(fJid, fPassword.String()); + fClient = new OurClient(fJid, fPassword.String()); fClient->setServer(fServer.String()); if (fPort > 0) fClient->setPort(fPort); @@ -1471,7 +1473,6 @@ JabberHandler::handleMessageEvent(const gloox::JID& from, gloox::MessageEventTyp void JabberHandler::handleChatState(const gloox::JID& from, gloox::ChatStateType state) { -printf("------ %d\n", state); // We're interested only in some states if (state == gloox::ChatStateActive || state == gloox::ChatStateInvalid) return; @@ -1819,7 +1820,7 @@ JabberHandler::handleLog(gloox::LogLevel level, gloox::LogArea, const std::string& msg) { if (level >= gloox::LogLevelWarning) - printf("%s\n", msg.c_str()); + std::cout << msg << std::endl; } @@ -1872,6 +1873,22 @@ JabberHandler::handleVCardResult(gloox::VCardHandler::VCardContext context, } +OurClient::OurClient(const gloox::JID jid, const char* password) + : + gloox::Client(jid, password) +{ +} + + +void +OurClient::handleTag(gloox::Tag* tag) +{ + if (DEBUG_ENABLED) + std::cerr << "Tag\t" << tag->xml() << std::endl; + gloox::Client::handleTag(tag); +} + + InviteHandler::InviteHandler(gloox::ClientBase* client, JabberHandler* handler) : gloox::MUCInvitationHandler(client), diff --git a/protocols/xmpp/JabberHandler.h b/protocols/xmpp/JabberHandler.h index 4427777..918b3d0 100644 --- a/protocols/xmpp/JabberHandler.h +++ b/protocols/xmpp/JabberHandler.h @@ -38,6 +38,7 @@ class BList; class InviteHandler; +class OurClient; typedef KeyMap RoomMap; @@ -108,7 +109,7 @@ private: ChatProtocolMessengerInterface* fServerMessenger; - gloox::Client* fClient; + OurClient* fClient; gloox::ConnectionTCPClient* fConnection; gloox::VCardManager* fVCardManager; @@ -211,6 +212,14 @@ private: }; +class OurClient : public gloox::Client { +public: + OurClient(const gloox::JID jid, const char* password); + + virtual void handleTag(gloox::Tag* tag); +}; + + class InviteHandler : public gloox::MUCInvitationHandler { public: InviteHandler(gloox::ClientBase* parent, JabberHandler* handler);