v.7 by Sergey Chernov
2018-10-16 18:10

Groups

All chats are based on the group notion. The group is a common ground for any message exchange. It is where users exchange messages. And vice versa, if users do mesage exchange, they do it with some sort of groups. Each user participating in a group has a subscription. Subscription allow users read, write and arministate groups they are involved in. To understand main the object relations see the simplified diagram:

graph LR p2p(private chat) --> group room(room) --> group channel(channel)--> group group -.-> subscription1 group -.-> subscription2 group -.-> subscription3 subscription1 -.-> user1 subscription2 -.-> user2 user1 -.-> contact1 user1 -.-> contact2 user1 -.-> contact3 user2 -.-> contact4 user2 -.-> contact5 user2 -.-> contact6 contact4 -.-> user3 contact1 -.-> user3

Below wediscuss in details different types of groups.

Private chats (p2p)

Are intended for peer-to-peer (often mentionaed as p2p in docs) conversations. These simplest group type have some limitations:

  • private chats can't be deleted once created
  • invitations are disabled
  • both users gane permanent RW access
  • there us always exactly 2 participants
  • administration is disabled

The only way for a party to control some p2p chat is to manipulate its unichat subscription.

Channels

These are groups where limited number fo admins have RW access and all other subscribers (that might me thousands) have only read permission. Channels are most often public groups, nut not necessarily.

  • channels always set RO access for invited users

Rooms

Chat rooms are most common chat objects, by default all participants have RW access. Rooms have no special limitations.