Add user to MUC instantly (ejabberd,xmpp) - xmpp

Is it possible to add a user instatnly to the MUC? I created room, granted the new user membership and role but then the added user still doesn't exist in the room.
He appears in the users list only if he accepts an invitation / or joins to this room by his own.
Any ideas? Is it possible?
Thanks

Related

What is the difference between occupants and affiliations?

Want to know how to add occupants in room.
Can we add occupants without adding affilitions?
They are defined in MUC specification:
5.1 Roles:
Roles are temporary in that they do not necessarily persist across a user's visits to the room and MAY change during the course of an occupant's visit to the room.
5.2 Affiliations:
These affiliations are long-lived in that they persist across a user's visits to the room and are not affected by happenings in the room. In addition, there is no one-to-one mapping between these affiliations and an occupant's role within the room. Affiliations are granted, revoked, and maintained based on the user's bare JID, not the nick as with roles.

How to cancel MUC invitation with Smack 4.2?

Let assume that room owner invite to other smack user when this user is offline. After room owner decided to kick smack user. By the way smack user is still offline. I think, I must cancel invitation. when the above scenario is realized, smack throw exception "not allowed user". Exactly at this point (actually i catch this exception), I want to cancel invitation and update room info node. How can I this?
You can't revoke directly the invitation.
However, "kick" is like a temporary ban (an Admin can force an user to leave the MUC) that is not what are you looking for.
You are looking for a permanent BAN, that's the equivalent to set the "privileges" of ROOM OUTCAST to an user.
So you can try to put the user in the Outcast list: when he will accept the invitation, he will not found the grants to join.

Prevent multiple roles for a user in suitecrm

I got a requirement in Suitecrm to prevent giving multiple roles for a same user who have been assigned a role already. How to prevent giving multiple roles for a user in suitecrm.
Thanks in advance.
override pop view for users using this link: here
Add a check there to display only those users for a role which doesn't belong to any role. Hopefully you can write logic for finding users without role(s)

Leave group chat, and get removed from member list

I am working on the chat application.
I want to implement the group user chat and I have successfully done that.
Now I want toad the functionality by which user can leave the group. I found leave the group but it seems like it's just making user unavailable but not removing user from the member list.
Is there any way by which user remove himself from the member list?
I have read the xep 0045 for it, in that there is a topic for existing the room which seems make user unavailable but not removing from member list.
http://xmpp.org/extensions/xep-0045.html#exit
If anyone has any idea how to do this please share it.
Leaving a room in XMPP (0045) is accomplished by sending an unavailable presence to that room (see XMPPRoom.leaveRoom() in the XMPPFramework) - that should remove them from the occupants of that room (we do this with our app regularly).
"Members list" - is a MUC feature for moderator use cases, it is not related to user. Just leave room as described in XEP, you no need to modify members list. In fact, you no need to add user in this list too, simple chat application should only tracks <presence> stanzas from and to room JID.

How to configure XMPP to allow all logged in user to see each other and chat with each other?

I am new to XMPP.
I am using Openfire server, and created a console client using Smack library.
My usecase:
All users anonymous, logged in (In future, website visitors) will be able to see other anonymous, logged-in users. And they can initiate a private chat (one-to-one) with any of them.
So, I am able to logged in as Anonymous user, but I am not able to see other Anon / Logged in users (using Roster), because they are not in anon user's roster.
So, What should be configuration OR custom=component/code to to achieve this usecase?
Do I need to create server component? Any hint? OR
It can be done using proper configuration?
Cheers
You should create Multi chat room MUC, and join users after login to this room.After user joins muc room they can get paricipiants list.