Fix display when sending message to a full JID
This path fixes a regression in mcabber 1.1.1.
The message was shown as if it was a MUC private message.
Thanks to Minoru for the report.
--- a/mcabber/mcabber/commands.c Sun Sep 06 21:37:29 2020 +0200
+++ b/mcabber/mcabber/commands.c Tue Sep 15 21:31:00 2020 +0200
@@ -1289,9 +1289,13 @@
}
// Check if we're sending a message to a conference room
- isroom = !!roster_find(bare_jid, jidsearch, ROSTER_TYPE_ROOM);
- muc_nick = jid_get_resource_name(fjid);
- isroom = isroom && !muc_nick;
+ if (NULL != roster_find(bare_jid, jidsearch, ROSTER_TYPE_ROOM)) {
+ muc_nick = jid_get_resource_name(fjid);
+ isroom = !muc_nick; // if a resource is specified, then it's a muc private message, not a room
+ } else {
+ isroom = false;
+ muc_nick = NULL;
+ }
// local part (UI, logging, etc.)
if (subj)