|
|
The blog client is a [BSP client](BSP) that synchronises blog posts among groups of devices. Only the creator of a blog can write posts. Posts and comments from other blogs can be reblogged with optional comments.
|
|
|
|
|
|
### Group identifiers
|
|
|
|
|
|
The client's identifier is `org.briarproject.briar.blog`.
|
|
|
|
|
|
Each blog has its own group. The [group descriptor](BSP#group-identifiers) is a [BDF list](BDF) with two elements: `author` (list) and `rss` (boolean). The `author` list has three elements: `formatVersion` (int), `nickname` (string) and `publicKey` (raw).
|
|
|
|
|
|
`rss` indicates whether the blog contains an imported RSS feed or a user's personal blog. `nickname` is used as the blog's title. Posts are signed with the private key corresponding to `publicKey`.
|
|
|
|
|
|
### Message types
|
|
|
|
|
|
**0: POST** - A blog post. The message body is a BDF list with three elements: `messageType` (int), `content` (string), and `signature` (raw).
|
|
|
|
|
|
The signature covers a BDF list with three elements: `groupId` (unique ID), `timestamp` (int), and `content` (string). The group ID and timestamp are taken from the message header. The public key from the group descriptor is used for verifying the signature.
|
|
|
|
|
|
**1: COMMENT** - A pointer to a reblogged post or comment, with an optional comment. The message body is a BDF list with five elements: `messageType` (int), `comment` (string or null), `parentOriginalId` (unique ID), `parentId` (unique ID), and `signature` (raw).
|
|
|
|
|
|
`parentOriginalId` is the ID of a post or comment in this group or another group. `parentId` is the ID of the parent message, which is a post, comment, wrapped post or wrapped comment in this group that had the ID `parentOriginalId` in the group where it was originally posted. The signature covers a BDF list with five elements: `groupId` (unique ID), `timestamp` (int), `comment` (string or null), `parentOriginalId` (unique ID), and `parentId` (unique ID). The group ID and timestamp are taken from the message header. The public key from the group descriptor is used for verifying the signature.
|
|
|
|
|
|
**2: WRAPPED_POST** - A reblogged post from another blog. The message body is a BDF list with five elements: `messageType` (int), `copiedGroupDescriptor` (list), `copiedTimestamp` (int), `copiedContent` (string), and `copiedSignature` (raw).
|
|
|
|
|
|
`copiedGroupDescriptor` is the descriptor of the blog where the post was originally posted. `copiedTimestamp`, `copiedContent` and `copiedSignature` are copied from the original post. The public key from the original group descriptor is used for verifying the signature. The original group ID must be calculated, as it is covered by the signature. The original message ID must also be calculated, as it is referenced by comments.
|
|
|
|
|
|
**3: WRAPPED_COMMENT** - A reblogged comment from another blog. The message body is a BDF list with eight elements: `messageType` (int), `copiedGroupDescriptor` (list), `copiedTimestamp` (int), `copiedComment` (string or null), `copiedParentOriginalId` (unique ID), `copiedParentId` (unique ID), `copiedSignature` (raw), and `parentId` (unique ID).
|
|
|
|
|
|
`copiedGroupDescriptor` is the descriptor of the blog where the comment was originally posted. `copiedTimestamp`, `copiedComment`, `copiedParentOriginalId`, `copiedParentId` and `copiedSignature` are copied from the original comment. The public key from the original group descriptor is used for verifying the signature. The original group ID must be calculated, as it is covered by the signature. The original message ID must also be calculated, as it is referenced by comments. `parentId` is the ID of the parent message, which is a post, comment, wrapped post or wrapped comment in this group that had the ID `copiedParentOriginalId` in the group where the parent was originally posted, and the ID `copiedParentId` in the group where the comment was originally posted.
|
|
|
|
|
|
### Validity policy
|
|
|
|
|
|
* A post is valid if it is well-formed and has a valid signature.
|
|
|
* A comment is valid if it is well-formed, has a valid signature, and references a valid message of any type in the same group.
|
|
|
|
|
|
### Storage policy
|
|
|
|
|
|
* All messages are stored.
|
|
|
|
|
|
### Sharing policy
|
|
|
|
|
|
* All posts and comments are shared.
|
|
|
* Wrapped posts and wrapped comments are not shared unless they are referenced by a post or comment. |