chat: fix bare domain name

TIL XMPP JIDs can be bare domain names:

    xmppipe --chat example.com

xmppipe parses that as: example.com@yourdomain.com

As a hacky workaround, for chats only, check if the JID contains a
period. JIDs containing a period such as firstname.lastname need to use
the full JID:

    xmppipe --chat firstname.lastname@example.com
master
Michael Santos 7 months ago
parent f8db1cbd99
commit 449099958a

@ -250,7 +250,9 @@ int main(int argc, char **argv) {
state->out = xmppipe_strdup(state->room);
state->mucjid = xmppipe_mucjid(state->out, state->resource);
} else if (!(state->opt & XMPPIPE_OPT_GROUPCHAT)) {
state->out = xmppipe_chatjid(state->room, state->server);
state->out = strchr(state->room, '.')
? xmppipe_strdup(state->room)
: xmppipe_chatjid(state->room, state->server);
}
if (xmppipe_fmt_init() < 0)

Loading…
Cancel
Save