summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/SwiftenDevelopersGuide/Examples/EchoBot')
-rw-r--r--Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp
index a03c3db..f332fc8 100644
--- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp
+++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp
@@ -14,16 +14,8 @@ using namespace boost;
Client* client;
-void handleConnected() {
- std::cout << "Connected" << std::endl;
-}
-
-void handleMessageReceived(Message::ref message) {
- // Echo back the incoming message
- message->setTo(message->getFrom());
- message->setFrom(JID());
- client->sendMessage(message);
-}
+void handleConnected();
+void handleMessageReceived(Message::ref message);
int main(int, char*) {
SimpleEventLoop eventLoop;
@@ -38,3 +30,14 @@ int main(int, char*) {
delete client;
return 0;
}
+
+void handleConnected() {
+ std::cout << "Connected" << std::endl;
+}
+
+void handleMessageReceived(Message::ref message) {
+ // Echo back the incoming message
+ message->setTo(message->getFrom());
+ message->setFrom(JID());
+ client->sendMessage(message);
+}