summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-11-09 06:01:47 +0100
committerFlorent Le Coz <louiz@louiz.org>2013-11-09 06:01:47 +0100
commitccebe901d7d76dfddc082d994efa54ef2aefee57 (patch)
tree97a542cce7c3c3185553859f679dc074f8f0286f /src/main.cpp
parenta418b6ed5d70f0e61e71bb1adce2a693ade89e30 (diff)
downloadbiboumi-ccebe901d7d76dfddc082d994efa54ef2aefee57.tar.gz
biboumi-ccebe901d7d76dfddc082d994efa54ef2aefee57.tar.bz2
biboumi-ccebe901d7d76dfddc082d994efa54ef2aefee57.tar.xz
biboumi-ccebe901d7d76dfddc082d994efa54ef2aefee57.zip
Check UTF-8 encoding, and convert strings to UTF-8
Handle conversion errors properly by inserting � instead. Add a binary header to provide portable way to write binary literals (I like them) Also add a test file. ref #2404
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp29
1 files changed, 7 insertions, 22 deletions
diff --git a/src/main.cpp b/src/main.cpp
index b0fb140..b7fa01e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,31 +1,16 @@
-#include <irc/irc_client.hpp>
-#include <xmpp/xmpp_component.hpp>
#include <network/poller.hpp>
-
-#include <xmpp/xmpp_parser.hpp>
-#include <xmpp/xmpp_stanza.hpp>
+#include <xmpp/xmpp_component.hpp>
#include <memory>
-#include <xmpp/jid.hpp>
-#include <irc/iid.hpp>
-
-#include <iostream>
-
int main()
{
Poller p;
- // Now I'm the bridge, creating an ircclient because needed.
- std::shared_ptr<IrcClient> c = std::make_shared<IrcClient>();
- p.add_socket_handler(c);
- std::shared_ptr<IrcClient> d = std::make_shared<IrcClient>();
- p.add_socket_handler(d);
- std::shared_ptr<IrcClient> e = std::make_shared<IrcClient>();
- p.add_socket_handler(e);
- c->connect("localhost", "7877");
- d->connect("localhost", "7878");
- e->connect("localhost", "7879");
- while (true)
- p.poll();
+ std::shared_ptr<XmppComponent> xmpp_component =
+ std::make_shared<XmppComponent>("irc.localhost", "secret");
+ p.add_socket_handler(xmpp_component);
+ xmpp_component->start();
+ while (p.poll())
+ ;
return 0;
}