|
|
|
# Private groups
|
|
|
|
Briar offers to types of group messaging: private groups and forums.
|
|
|
|
This article will focus on private groups, how they work in general and how the
|
|
|
|
repeater could be used to improve them.
|
|
|
|
|
|
|
|
## How it works
|
|
|
|
In centralized networks group messaging is pretty simple. Messages are sent to
|
|
|
|
and retrieved from a server known to all group members:
|
|
|
|
|
|
|
|
```mermaid
|
|
|
|
graph BT
|
|
|
|
subgraph Group
|
|
|
|
A[Alice]
|
|
|
|
S((Server))
|
|
|
|
style S fill:#f40
|
|
|
|
B[Bob]
|
|
|
|
C[Carol]
|
|
|
|
D[Dave]
|
|
|
|
A-- send and fetch messages -->S
|
|
|
|
B-- send and fetch messages -->S
|
|
|
|
C-- send and fetch messages -->S
|
|
|
|
D-- send and fetch messages -->S
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
Without such a central server synchronizing messages between all the group
|
|
|
|
members is more difficult.
|
|
|
|
In Briar, the creator of a group is taking on the
|
|
|
|
role of the server for this particular group instead.
|
|
|
|
|
|
|
|
Illustration:
|
|
|
|
|
|
|
|
Alice wants to create a private group for herself and her friends:
|
|
|
|
|
|
|
|
```mermaid
|
|
|
|
graph LR
|
|
|
|
A[Alice]
|
|
|
|
subgraph Friends
|
|
|
|
A1[Alice]
|
|
|
|
style A1 fill:#f9f
|
|
|
|
end
|
|
|
|
A-- creates group --> A1
|
|
|
|
```
|
|
|
|
|
|
|
|
As creator, it's up to Alice to invite new members (regular members are not
|
|
|
|
allowed to invite anyone):
|
|
|
|
|
|
|
|
```mermaid
|
|
|
|
graph LR
|
|
|
|
subgraph Group
|
|
|
|
A[Alice]
|
|
|
|
style A fill:#f9f
|
|
|
|
end
|
|
|
|
subgraph Contacts
|
|
|
|
B[Bob]
|
|
|
|
C[Carol]
|
|
|
|
D[Dave]
|
|
|
|
end
|
|
|
|
A-. invites .->B
|
|
|
|
A-. invites .->C
|
|
|
|
A-. invites .->D
|
|
|
|
subgraph Group
|
|
|
|
A1[Alice]
|
|
|
|
B1[Bob]
|
|
|
|
C1[Carol]
|
|
|
|
D1[Dave]
|
|
|
|
B-- joins -->B1
|
|
|
|
C-- joins -->C1
|
|
|
|
D-- joins -->D1
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
To synchronize the messages between the group members a star topology is formed
|
|
|
|
around the creator (Alice in our case).
|
|
|
|
When a member sends a message to the group, they'll send it to Alice and
|
|
|
|
she will forward it to the other group members.
|
|
|
|
|
|
|
|
|
|
|
|
```mermaid
|
|
|
|
graph TB
|
|
|
|
subgraph Group
|
|
|
|
A[Alice]
|
|
|
|
style A fill:#f9f
|
|
|
|
B[Bob]
|
|
|
|
C[Carol]
|
|
|
|
D[Dave]
|
|
|
|
A-- send and receive messages ---B
|
|
|
|
A-- send and receive messages ---C
|
|
|
|
A-- send and receive messages ---D
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
You might ask yourself: Why aren't messages synchronized between
|
|
|
|
group members as well ?
|
|
|
|
For example: Bob and Carol are contacts in Briar, they could
|
|
|
|
exchange group messages without having to wait for Alice to be online:
|
|
|
|
|
|
|
|
|
|
|
|
```mermaid
|
|
|
|
graph TB
|
|
|
|
subgraph Group
|
|
|
|
A[Alice]
|
|
|
|
style A fill:#f9f
|
|
|
|
B[Bob]
|
|
|
|
C[Carol]
|
|
|
|
D[Dave]
|
|
|
|
A-- sync messages ---B
|
|
|
|
A-- sync messages ---C
|
|
|
|
A-- sync messages ---D
|
|
|
|
B-. could sync messages .-C
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
There's a good reason Briar doesn't do this by default: metadata.
|
|
|
|
If Bob and Carol sync messages directly, the other group members can learn
|
|
|
|
of their relationship.
|
|
|
|
In some situations this might still be acceptable (e.g. the group members know of the relationship already
|
|
|
|
because they are all friends),
|
|
|
|
therefore Briar offers the option to reveal a contact relationship to the group
|
|
|
|
and improve the message circulation:
|
|
|
|
|
|
|
|
```mermaid
|
|
|
|
graph TB
|
|
|
|
B1[Bob]
|
|
|
|
|
|
|
|
subgraph Group
|
|
|
|
A[Alice]
|
|
|
|
style A fill:#f9f
|
|
|
|
B[Bob]
|
|
|
|
C[Carol]
|
|
|
|
D[Dave]
|
|
|
|
A-- sync messages ---B
|
|
|
|
A-- sync messages ---C
|
|
|
|
A-- sync messages ---D
|
|
|
|
B-- sync messages ---C
|
|
|
|
linkStyle 3 stroke:#ff3,stroke-width:4px
|
|
|
|
end
|
|
|
|
subgraph Contact relationship
|
|
|
|
C1[Carol]
|
|
|
|
B1-. are contacts .-C1
|
|
|
|
C1-- reveal relationship to group -->A
|
|
|
|
end
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
## Problems |