eJabberd无法邀请同一用户加入多个MUC房间问题求助
Hey there, let's break down why your second send_direct_invitation call isn't working. I've run into similar quirks with ejabberd's MUC invitation commands before, so here are the most likely fixes to try:
Double-check if the user is already in the target MUC
Even though you mentioned it's a different room, it's worth verifying with this command (replace[new-room-jid]with your second room's full JID, e.g.,conference2.msg.hajmobility.my):sudo -u ejabberd /usr/sbin/ejabberdctl get_room_occupants [new-room-jid]If the user's already joined the new room, ejabberd won't send a duplicate invitation by default.
Confirm your command syntax for the second room is fully updated
Your original command targetsconference.msg.hajmobility.my—make sure you've replaced that exact part with your new room's JID. Also, verify that the sender JID (msg_din@msg.hajmobility.my:msg_apool@msg.hajmobility.my) has permission to send invites to the new room. If the sender isn't an owner, admin, or authorized member of the new MUC, ejabberd will block the request.Check ejabberd's MUC config for invitation restrictions
Pop open your ejabberd config file (usually/etc/ejabberd/ejabberd.yml) and look under themod_mucsection for these settings:allow_invites: Ensure this is set totruefor the new room's host.max_invitations_per_user: If this is capped at 1, the sender might hit a limit after the first invite.invite_only: If the new room is invite-only, confirm the sender has the necessary permissions (owner/admin) to send invites.
Clear session caches or reload ejabberd config
Sometimes ejabberd caches session states that interfere with new invitations. You can try reloading the config without full downtime:sudo -u ejabberd /usr/sbin/ejabberdctl reload_configIf that doesn't work, a gentle restart of the service might help:
sudo systemctl restart ejabberdDig into ejabberd logs for explicit errors
This is the most reliable way to pinpoint the issue. Run this command to filter MUC-related logs in real time:sudo tail -f /var/log/ejabberd/ejabberd.log | grep -i mucTry sending the second invitation while watching the logs—you'll see clear errors like permission denied, room not found, or user already present that will tell you exactly what's wrong.
内容的提问来源于stack exchange,提问作者DiN CS

