X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=tictactoe.c;h=ed74e49d5151096749cc8b2658ed812d4e956a92;hb=5288c13efe67885e6fb9384484b98293eeac535a;hp=b57c1b9e945f9464dccbdf5a536a00041ed01ac2;hpb=8729c58972d65ab4b4b7ef3da9bcaf0d7f237d4c;p=cascardo%2Fhcxmpp.git diff --git a/tictactoe.c b/tictactoe.c index b57c1b9..ed74e49 100644 --- a/tictactoe.c +++ b/tictactoe.c @@ -28,18 +28,14 @@ #include "xmpp.h" #include "sasl.h" #include "bind.h" +#include "disco.h" static void write_stream (hc_xmpp_t *); static void send_message_test (hc_xmpp_t *xmpp) { - iks *msg; - msg = iks_new ("message"); - iks_insert_attrib (msg, "to", "metal@jabber-br.org"); - iks_insert_cdata (iks_insert (msg, "body"), "pubsub", 0); - hc_xmpp_send_iks (xmpp, msg); - iks_delete (msg); + hc_xmpp_send_disco_info (xmpp, hc_xmpp_server (xmpp)); } static int @@ -61,6 +57,10 @@ myhook (void *data, int type, iks *stanza) if (hc_xmpp_status (data) == HC_XMPP_SESSION) send_message_test (data); } + else if (!iks_strcmp (ns, HC_XMPP_NS_DISCO_INFO)) + { + hc_xmpp_recv_disco (data, stanza); + } } else if (!iks_strcmp (iks_name (stanza), "stream:features")) {