Skip to content

Commit

Permalink
Correct link and fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
knatten committed Mar 22, 2012
1 parent b5c3836 commit 5f9ec0b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions gloox/bot.cpp
@@ -1,5 +1,5 @@
//A basic gloox tutorial by Anders Schau Knatten
//Read more at http://blog.knatten.org/2012/03/22/basic-gloox-tutorial/
//Read more at http://blog.knatten.org/2012/03/23/basic-gloox-tutorial/
//To compile on Linux: g++ -o bot bot.cpp -lgloox -lpthread
#include <iostream>
#include <string>
Expand Down Expand Up @@ -44,7 +44,6 @@ ostream& operator<<(ostream& os, const Message& stanza) {

class ConnListener : public ConnectionListener {
public:
ConnListener() {}
virtual void onConnect() {
cout << "ConnListener::onConnect()" << endl;
}
Expand All @@ -60,7 +59,7 @@ class ConnListener : public ConnectionListener {
class Bot : public MessageHandler {
public:
Bot() {
JID jid( "bot@localhost" );
JID jid("bot@localhost");
client = new Client( jid, "botpwd" );
connListener = new ConnListener();
client->registerMessageHandler( this );
Expand All @@ -74,9 +73,9 @@ class Bot : public MessageHandler {
}

virtual void handleMessage( const Message& stanza, MessageSession* session = 0 ) {
cout << "Received message: " << stanza << endl;
Message msg(stanza.subtype(), stanza.from(), "Tell me more about " + stanza.body() );
client->send( msg );
cout << "Received message: " << stanza << endl;
Message msg(Message::Chat, stanza.from(), "Tell me more about " + stanza.body() );
client->send( msg );
}

private:
Expand Down

0 comments on commit 5f9ec0b

Please sign in to comment.