diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-05-01 09:13:23 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-05-01 09:13:23 (GMT) |
commit | d94737ef177524014fbf9b1ee2b446825536514b (patch) | |
tree | 004df9a022c7c42cad39162ffa84537b63c1953d /Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot0x.cpp | |
parent | 4091acca56c189a350e195450272ec4471ba91cd (diff) | |
download | swift-contrib-d94737ef177524014fbf9b1ee2b446825536514b.zip swift-contrib-d94737ef177524014fbf9b1ee2b446825536514b.tar.bz2 |
Updated Swiften developers guide.
Added call to setAlwaysTrustCertificates in examples.
Added C++0x example.
Diffstat (limited to 'Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot0x.cpp')
-rw-r--r-- | Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot0x.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot0x.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot0x.cpp index b4ccc21..11773ae 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot0x.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot0x.cpp @@ -13,25 +13,19 @@ int main(int, char**) { SimpleEventLoop eventLoop; BoostNetworkFactories networkFactories(&eventLoop); - // Initialize the client with the JID and password Client client("echobot@wonderland.lit", "mypass", &networkFactories); - - // When the client is convnected, send out initial presence + client.setAlwaysTrustCertificates(); client.onConnected.connect([&] { - client.sendPresence(Presence::create("Send me a message")); + std::cout << "Connected" << std::endl; }); - - // When the client receives an incoming message, echo it back client.onMessageReceived.connect([&] (Message::ref message) { message->setTo(message->getFrom()); message->setFrom(JID()); client.sendMessage(message); }); - - // Start the client client.connect(); - // Run the event loop to start processing incoming network events eventLoop.run(); + return 0; } |