Make the server argument optional. Passing a NULL domain arg to xmpp_connect_client()
now derives the domain from the jid. Is it reasonable to just remove the 'domain' (more properly server) argument directly? The library should always handle this and I can't think why you'd want to override unless maybe if you have a proxy.
This commit is contained in:
@@ -45,12 +45,19 @@ int main(int argc, char **argv)
|
||||
xmpp_ctx_t *ctx;
|
||||
xmpp_conn_t *conn;
|
||||
xmpp_log_t log;
|
||||
char *jid, *pass;
|
||||
char *server;
|
||||
|
||||
if (argc != 4) {
|
||||
if ((argc < 3) || (argc > 4)) {
|
||||
fprintf(stderr, "Usage: basic <jid> <pass> <server>\n\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
jid = argv[1];
|
||||
pass = argv[2];
|
||||
if (argc >= 4) server = argv[3];
|
||||
else server = NULL;
|
||||
|
||||
/* init library */
|
||||
xmpp_initialize();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user