From 449099958af42c057a07a0e4ce4d3d09e55920c5 Mon Sep 17 00:00:00 2001 From: Michael Santos Date: Tue, 31 Oct 2023 07:34:18 -0400 Subject: [PATCH] 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 --- src/xmppipe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xmppipe.c b/src/xmppipe.c index 333ad0e..1988bd4 100644 --- a/src/xmppipe.c +++ b/src/xmppipe.c @@ -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)