Forum sharing protocol modifies state external to session
Sub-task of #456 (closed).
Session identifiers
Each invitation session has the same identifier as the forum to which the invitation refers. There is one session per forum (and contact), regardless of how many times the parties share and leave the forum.
Messages
The sharing protocol uses five message types. It should be noted that all communication happens solely between the sharer and the contacts she invites.
0: INVITE - This is send by the sharer to one of her contacts. The content is a BDF list with these elements:
-
type
(int) The type of the message, here 0 -
previous_msg_id
(raw or null) is the identifier of the previous message sent by this party in this session, if any, which is a dependency. -
group_descriptor
(list) aBdfList
that makes up the group descriptor of the forum that is invited to with these elements:-
forum_name
(string) name of the forum -
forum_salt
(raw) salt to uniquely identify this forum
-
-
message
(string or null) optional invitation message
1: ACCEPT - This can be sent by contacts that received a sharing invitation and must be sent if they want to subscribe to the forum. The content is a BDF list with these elements:
-
type
(int) The type of the message, here 1 -
forum_id
(raw) TheGroupId
of the forum. It can be calculated fromforum_name
andforum_salt
. -
previous_msg_id
(raw or null) is the identifier of the previous message sent by this party in this session, if any, which is a dependency.
2: DECLINE - This can be sent by contacts that received a sharing invitation and do not want to add the forum. The content is a BDF list with these elements:
-
type
(int) The type of the message, here 2 -
forum_id
(raw) TheGroupId
of the forum. It can be calculated fromforum_name
andforum_salt
. -
previous_msg_id
(raw or null) is the identifier of the previous message sent by this party in this session, if any, which is a dependency.
3: LEAVE - Must be sent by a contact that is unsubscribing from the forum. The content is a BDF list with these elements:
-
type
(int) The type of the message, here 3 -
forum_id
(raw) TheGroupId
of the forum. It can be calculated fromforum_name
andforum_salt
. -
previous_msg_id
(raw) is the identifier of the previous message sent by this party in this session which is a dependency.
4: ABORT - This should be send by a contact that encountered an error, so that it can not complete the protocol. The content is a BDF list with these elements:
-
type
(int) The type of the message, here 4 -
forum_id
(raw) TheGroupId
of the forum. It can be calculated fromforum_name
andforum_salt
. -
previous_msg_id
(raw or null) is the identifier of the previous message sent by this party in this session, if any, which is a dependency.