Added parser, server name and file descriptor to context
[cascardo/chat.git] / xmpp.c
diff --git a/xmpp.c b/xmpp.c
index f42c55c..a6a0a09 100644 (file)
--- a/xmpp.c
+++ b/xmpp.c
 #include <stdlib.h>
 #include "xmpp.h"
 #include "xmpp_internal.h"
 #include <stdlib.h>
 #include "xmpp.h"
 #include "xmpp_internal.h"
+#include "iksemel_extra.h"
 
 hc_xmpp_t *
 
 hc_xmpp_t *
-hc_xmpp_new (void)
+hc_xmpp_new (iksStreamHook *hook, char *server)
 {
   hc_xmpp_t *xmpp = malloc (sizeof (hc_xmpp_t));
 {
   hc_xmpp_t *xmpp = malloc (sizeof (hc_xmpp_t));
+  xmpp->server = strdup (server);
+  xmpp->parser = iks_extra_stream_new (xmpp, hook);
+  xmpp->fd = hc_tcp_connect (server, "xmpp-client");
   xmpp->tls = NONE;
   xmpp->sasl = NONE;
   return xmpp;
   xmpp->tls = NONE;
   xmpp->sasl = NONE;
   return xmpp;