What is the difference between occupants and affiliations? - xmpp

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.

Related

Add user to MUC instantly (ejabberd,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

Yammer API get list of all users in All Company

https://www.yammer.com/api/v1/users/ does not work and only gives me users in the current user’s Yammer network. I need every single user.
If All Company had an ID I could use https://www.yammer.com/api/v1/users/in_group/
Moreover, https://www.yammer.com/api/v1/groups does not seem to have All Company within it
On the backend, All Company is not actually a group. It behaves kind of like a group in the UI, but with notable difference like users not being able to leave All Company. This and other difference betray the fact that the Yammer backend does not in fact treat All Company as a normal group.
Hitting the users.json endpoint will give you data about all users in the users' current network. This list of users is the same as the list of users who are "members" of the All Company group for that network.

How to model users in the system?

I am working on system that will manage orders. Orders can be created via admin or via customer. Employee can take orders and change it's status.
My system should have three global types of users:
Admin - this type of users mostly uses WEB interface. Admins have different access levels, so some of them can only create orders, and others - edit core info about pricing and so on.
Customer - this type of users uses customer's mobile app. Main action is to add and cancel orders.
Employee - this type of users uses employee's mobile app. Employees can see open orders, assign themselves to orders and change order statuses.
Also, Customer and Employee can be authorised with phone number, that can be changed at some time (independently of each other). Admins can be authorised with uname + pword.
Current solution has one table for Admins, one for Customers and one for Employees.
So first part of question is how to structure database properly?
The second part is about authorising in REST api. In current solution I have three endpoints, that are authireses usertype independently.
admins/auth
customers/auth
employees/auth
And my thoughts is to keep three tables as is, because each usertype is slightly different concept and really independent. And keep authorisation as is, but add something like roles and privileges to auth token to restrict access for some resources.

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.

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.