How to add Group in Openfire using XMPP programmatically - xmpp

I want to create GROUP in openfire using xmpp programmatically
see the image....
there are two groups in image I wish to add new groups in openfire using xmpp stanzas. If success then I wish to add members in particular groups.
I know how to create chat rooms (MUC) but groups are different than chatrooms. in groups rosters are persistent but in chatroom any user can enter and can at leave any time. so I want to create groups not like chatrooms.
I tried lot but it creates chatrooms only not the groups.

See this post for instance, if it can help you a little bit. Look for the addgroup in the java docs on the openfire.

Related

Is it possible for a Messenger Platform bot to initiate group chat with two or more humans?

Is it possible to create a bot that can connect two people (assume they're already registered with the bot) together by starting a group chat with the two of them?
If not, I'm open to alternate solutions to allow a bot to connect a human user with another human user, if anyone knows one.
Group chat is not supported. As an alternative you can build a chat extension which allows you to make some of your functionality available in group chat, including allowing multiple people to utilize shared resources. For examples, look at chat extensions that are already in the discover tab.

Which XEPs or eJabberd modules would be most suitable for conditionally and immediately changing the group of users a user is subscribed to?

Imagine that a database connected to an XMPP server stores users, it also stores an extra data column (let's call it dataId) for each user. The data column can take on three values: 1, 2, or 3.
In an XMPP client that logs in to the server, a list of users is displayed along with their XMPP presence status. The list displays users that all have the same value of of dataId. The client can change the dataId value that is displayed, meaning that if he switches the value, then the user is now somehow subscribed to the presence of the new list of users, but not to the old list of users.
I wonder if someone with experience with XMPP has a suggestion as to which XEPs or corresponding eJabberd (or Prosody) modules could be used or are best suited for this type of functionality.
I am slowly going through the XEPs, but there are a lot of them, and it's not clear as of yet which modules could be used, or if I would perhaps need to set up some custom code on my XMPP server to handle this.
You can take a look at XEP-0140. This behaves similar to rosters except that all users in a shared roster group will be able to see all other users in the group. You can create multiple shared roster groups and easily switch a user between them by adding or removing the user from the group. You can also have nested groups. You can look at the example on using shared roster groups for different cases here, using ejabberd.

What is the difference between a Roster Group and Multi-User Chat Rooms in Smack (XMPP library)?

I'am new to XMPP protocol and I'am working on a chat application in android using smack library. I'am stuck in creating group chat. I want to create a group, add members to it and send message to all members of a group (like whatsApp group). When searching about group chat i got two things
Group
: creating group using createGroup(String name) method present in Roster class.
Multi User chat : creating a Multi-user chat using MultiUserChatManager .
I'am getting confused regarding what is Group and what is Multi-User chat? Can anyone explain the basic difference between them and which one should i use and also how to send message to everyone in group ?
Roster Group
created using createGroup(String name) method present in Roster class
It's merely a group for your contacts, mostly for visual purposes in an IM client. It's like creating groups in phone contacts.
Multi-User Chat Rooms
created using MultiUserChatManager
MultiUserChat is used for creating chat rooms and adding various users as member of chat room. This should be used for group(Chat room with some members) messaging. This has nothing to do with Roster Group.

allow members to search for chat rooms they belong in XMPP with Smack API

I'm creating a chatroom website were each user can create a room and add his friends to that room and then start chatting!:D I'm using XMPP as the tool for this site with ejabberd server and smack API as client for room configuration! as you've already understood rooms are member only but I'm looking for a way to let each user see all rooms that she is a member of!
is it possible with xmpp protocol(to get all rooms that I'm member of)?how?
Does making the rooms public solve the problem? BTW how can I do it with smack API?
or better say, how can I choose to set a room public or hidden
thanks in advance
No, it is not possible in XMPP. This has been asked before, see: Is there a way to determine which Mulit User Conferences (MUC) a user has joined?
You could however keep track of these rooms yourself in a separate data store each time an user would enter (and/or leave) the room, but this is outside the scope of XMPP as mentioned earlier.

Openfire: Create MUC Room with custom fields

First of all, I'd like to provide some background information: I want to exchange unstructured data between various clients using XMPP. Data sources are supposed to publish their data simply to Mulit-User-Chat rooms (XEP-0045) so that any interested client can register.
XMPP MUC services can have various chat rooms and in order to find the ones my data sources push information to, I'd like to set some custom identification for that room. I figured muc#roominfo_<custom_ident> with some custom value would be great to accomplish that.
For testing purposes I wrote an application that creates a MUC on an XMPP service. Authentication etc. all works fine. I am using Smack to communicate with the XMPP server and to create the room. When I create the room, I am adding a field to the form field I requested before containing my custom information. The MUC is created and accessible. Yet the created custom field is not returned when I perform a disco#info on the room's JID.
I tested this with a local installation of (3.8.2).
I just wonder, if this is an issue of Openfire, that custom form fields (XEP-0068 used here in XEP-0045) are not stored when the MUC is created or if it is just not allowed according to XEP-0045? I read the specification for MUCs and crucially the respective section but couldn't find any evidence that convinced me, that it is explicitly not possible to create such custom form fields for a MUC.
Maybe I just misunderstand something in the specification? Has anyone tried something similar and it's working? If it is an issue of Openfire, I could try a different XMPP server.