From a38a702e8dd10a5abdd8cebe245c0cd31d6c4ddc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Mon, 6 Dec 2010 18:54:46 +0100
Subject: Fixed EchoComponent example.


diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp
index 4843b80..397bc21 100644
--- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp
+++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp
@@ -14,9 +14,9 @@ using namespace boost;
 
 class EchoComponent {
 	public:
-		EchoComponent(EventLoop* eventLoop, NetworkFactories* networkFactories) {
+		EchoComponent(EventLoop* eventLoop, NetworkFactories* networkFactories) : jid("echo.wonderland.lit") {
 			component = new Component(eventLoop, networkFactories,
-					JID("echo.wonderland.lit"), "EchoSecret");
+					jid, "EchoSecret");
 			component->onConnected.connect(bind(&EchoComponent::handleConnected, this));
 			component->onMessageReceived.connect(
 					bind(&EchoComponent::handleMessageReceived, this, _1));
@@ -48,11 +48,12 @@ class EchoComponent {
 		void handleMessageReceived(Message::ref message) {
 			// Echo back the incoming message
 			message->setTo(message->getFrom());
-			message->setFrom(JID());
+			message->setFrom(jid);
 			component->sendMessage(message);
 		}
 
 	private:
+		JID jid;
 		Component* component;
 		ComponentXMLTracer* tracer;
 };
-- 
cgit v0.10.2-6-g49f6