Skip to content

Commit

Permalink
Add voice state to spec
Browse files Browse the repository at this point in the history
  • Loading branch information
JFreegman authored and iphydf committed Feb 18, 2022
1 parent ef5d693 commit e568cd7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/Network/Tox/Application/GroupChats.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ tox.h header file.
\item Persistence across client restarts
\item Ability to set peer limits
\item Group roles (founder, moderators, users, observers)
\item Moderation (kicking, silencing)
\item Moderation (kicking, silencing, controlling which roles may speak)
\item Permanent group names (set on creation)
\item Topics (permission to modify is set by founder)
\item Password protection
\item Self-repairing (auto-rejoin on disconnect, group split protection,
state syncing)
\item Identity separation from the Tox ID
\item Ability to ignore peers
\item Unique nicknames which can be set on a per-group basis
\item Nicknames can be set on a per-group basis
\item Peer statuses (online, away, busy) which can be set on a per-group basis
\item Sending group name in invites
\item Ability to disconnect from group and join later with the same credentials
Expand Down Expand Up @@ -75,6 +75,20 @@ DHT is not used for any purpose at all. If a public group is set to
private, all DHT information related to the group will expire within a
few minutes.

\section{Voice state}

The voice state, which may only be set by the founder, determines which
group roles have permission to speak. There are three voice states:

\begin{itemize}
\item \textbf{\verb'Founder'} - Only the founder may speak.
\item \textbf{\verb'Moderator'} - The founder and moderators may speak.
\item \textbf{\verb'All'} - Everyone except observers may speak.
\end{itemize}

The voice state does not affect topic setting or private messages, and is
set to \textbf{\verb'All'} by default.

\section{Cryptography}

Groupchats use the
Expand Down Expand Up @@ -167,6 +181,7 @@ set of admin privileges, including:
\item Setting the group's privacy state
\item Setting group passwords
\item Toggling the topic lock
\item Setting the voice state
\end{itemize}

\subsection{Shared state}
Expand All @@ -175,10 +190,10 @@ Groups contain a data structure called the \textbf{\verb'shared state'}
which is given to every peer who joins the group. Within this structure
resides all data pertaining to the group that may only be modified by
the group founder. This includes the group name, the group type, the
peer limit, the topic lock, and the password. The shared state holds a
copy of the group founder's public encryption and signature keys, which
is how other peers in the group are able to verify the identity of the
group founder. It also contains a hash of the moderator list.
peer limit, the topic lock, the password, and the voice state. The shared
state holds a copy of the group founder's public encryption and signature
keys, which is how other peers in the group are able to verify the identity
of the group founder. It also contains a hash of the moderator list.

The shared state is signed by the founder using the group secret
signature key. As the founder is the only peer who holds this secret
Expand Down
1 change: 1 addition & 0 deletions src/Network/Tox/Application/GroupChatsPackets.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ A shared state packet payload is structured as follows:
\texttt{32} & Group Password \\
\texttt{32} & Moderator List Hash (Sha256) \\
\texttt{4} & Topic Lock State \\
\texttt{1} & Voice State \\
\end{tabular}

This packet contains information about the group shared state. Sent to
Expand Down

0 comments on commit e568cd7

Please sign in to comment.