Get server, user and password as parameters
[cascardo/chat.git] / tictactoe.c
index af9de7c..e929663 100644 (file)
@@ -38,10 +38,18 @@ loop (hc_xmpp_t *xmpp)
 int
 main (int argc, char **argv)
 {
-  char *server = "jabber-br.org";
-  char *user = "pubsub";
-  char *password = "pubsub";
+  char *server;
+  char *user;
+  char *password;
   hc_xmpp_t *xmpp;
+  if (argc < 4)
+    {
+      printf ("tictactoe server user password\n");
+      return 1;
+    }
+  server = argv[1];
+  user = argv[2];
+  password = argv[3];
   dns_init (NULL, 1);
   xmpp = hc_xmpp_new (hc_xmpp_hook, server, user, password);
   hc_xmpp_send_stream (xmpp);