briar issueshttps://code.briarproject.org/groups/briar/-/issues2018-04-16T16:24:37Zhttps://code.briarproject.org/briar/briar/-/issues/401Blog Protocol2018-04-16T16:24:37ZTorsten GroteBlog ProtocolDesign a protocol to be used for blog.
It should also be documented [in the wiki](https://code.briarproject.org/akwizgran/briar/wikis/BlogClient).
# Message types
Each blog has its own group. For exchanging invitations, the clie...Design a protocol to be used for blog.
It should also be documented [in the wiki](https://code.briarproject.org/akwizgran/briar/wikis/BlogClient).
# Message types
Each blog has its own group. For exchanging invitations, the client uses a separate group for each pair of contacts.
## Blog Group
The group descriptor is a BDF list with three elements: `name` (string), `author_name` (string) and `public_key` (raw). Posts are signed with the corresponding private key.
**0: POST** - The content is a BDF list with two elements: `content` (list) and `signature` (raw).
`content` is a list with six elements: `parent_id` (raw or null), `content_type` (string), `title` (string or null), `body` (raw), and `attachments` (dictionary or null). `parent_id` is the identifier of a post to which this is a follow-up. This parent post needs to be in the same blog group as this post. A blog clients must support a `content_type` of 'text/plain' for posts. Each key in `attachments` is the name of an attachment, and the value is a list with two elements: `content_type` (string) and `message_id` (raw).
`signature` is a signature over a list with three elements: `group_id` (raw), `timestamp` (int), and `content` (list). `group_id` and `timestamp` are taken from the [message header](BSP#message-format). `content` is described above.
**1: ATTACHMENT** - The content is raw data.
## Invitation Group
The group descriptor is a BDF list containing the unique IDs of the contacts' identities, sorted in ascending order as byte strings.
**0: INVITATION** - The content is a BDF list with four elements: `name` (string), `description` (string), `author` (list), and `message` (string or null).
The `author` is a list with two elements: `author_name` (string) and `public_key` (raw).
The identifier of the blog group to which the invitation refers can be calculated from `name`, `author_name` and `public_key`, as described above. `message` is an optional message from the inviter to the invitee.
**1: ACCEPT RESPONSE** - Response that indicates the peer wants to subscribe to the blog. The content is a BDF list with one element: `invitation_id` (raw) which is the identifier of an invitation created by the opposite peer.
**2: DECLINE RESPONSE** - Response that indicates the peer does not want to subscribe to the blog. The content is a BDF list with one element: `invitation_id` (raw) which is the identifier of an invitation created by the opposite peer.
**3: LEAVE** - The content is a BDF list with one element: `invitation_id` (raw), which is the identifier of an invitation created by either peer.
![blog-sharing](/uploads/3086686b3a8380d8c2e80c0014e20edf/blog-sharing.png)
# Open Questions
1. ~~Who can invite to blogs? Only the creator or everybody who subscribes to the blog?~~
* Every subscriber can invite others.
2. ~~Who can send a LEAVE message? Only subscribers or the creator as well?~~
* Both, the creator and the subscribers can send LEAVE messages at any time.
3. ~~How can we enforce that only the creator can post to the blog group? Should other clients reject message based on signature? If so, how do they verify?~~
* The signature on blog posts is verified using the public_key of the blog.
4. Which key pair is used for the blog? The long-term key-pair of its creator or a special blog key-pair?
5. What will be the `content_type` of blog posts? Are we going to support HTML initially? How will people create/edit the HTML?
* This has been outsourced to #421, but we need to know what kind of content type to accept and validate for the protocol.
* All blog clients should support `text/html` for the content type.
6. ~~Should blog posts not have a title as well? It is currently not part of the **POST** message.~~
* A `title` has been added to the **POST** message.
7. ~~Do we really need a note/message to be send along with the response?~~
* No! It has been removed from both responses.
8. Will blog authors be able to edit their post after they have published it already? If so, how? Special update message or re-use of `MessageId`?
* For the first phase, we'll assume that blog authors cannot edit published posts
9. Are we really going to use the 'sharing as action' paradigm for blogs? Maybe 'sharing as state' would be more suitable and allow for blogs to be available to more people more easily. ([discussion](https://code.briarproject.org/akwizgran/briar/issues/405#note_6043))
* akwizgran decided to do sharing as action as with forums, because this is easier to understand for users due to familiar metaphors.
* later we can add automatic sharing on top of the current mechanism
10. Should there be an option/flag that signals contacts you share the blog with that they automatically should share it with all of their contacts? (metadata leak?)
* If we do sharing as action, then no. At least, initially. Later we can add automatic sharing, but don't necessarily need a flag for it.
11. Are we going to support comments initially? If not, it might still be worth looking into how they could work, so the protocol does not need to be changed too much later on.
* WordPress-style comments won't be supported
* However, we could support Tumblr-style "reblog and add your own text" comments
* Reblogging would not be a phase 1 feature however
12. How do we tie the creator's identity to the blog (and its key pair)?
* the blog descriptor includes the creator's public key and she uses her private key to sign all posts.
13. Should the blog description be part of the group descriptor? If yes, it can never be changed, if no, it could be changed by sharers.Milestone DTorsten GroteTorsten Grotehttps://code.briarproject.org/briar/briar/-/issues/402Blog Client Implementation2018-04-16T16:24:37ZTorsten GroteBlog Client ImplementationA [BSP](https://code.briarproject.org/akwizgran/briar/wikis/BSP) Client similar to the `ForumManager` should be written that allows the user to
* create a new blog
* add posts to the blog
* get all blogs to be shown in the UI
* get ...A [BSP](https://code.briarproject.org/akwizgran/briar/wikis/BSP) Client similar to the `ForumManager` should be written that allows the user to
* create a new blog
* add posts to the blog
* get all blogs to be shown in the UI
* get blog posts for one blog
Here's an initial sketch of how the interface could look like:
```java
ClientId getClientId();
void addBlog(Blog b) throws DbException;
void addLocalPost(BlogPost p) throws DbException;
Blog getBlog(GroupId g) throws DbException;
Blog getBlog(Transaction txn, GroupId g) throws DbException;
Collection<Blog> getBlogs() throws DbException;
Collection<BlogPost> getBlogPosts(Blog b) throws DbException;
void registerRemoveBlogHook(RemoveBlogHook hook);
interface RemoveBlogHook {
void removingBlog(Transaction txn, Blog b) throws DbException;
}
```
# Open Questions
1. Should it be possible to delete a blog and if yes, how will all subscribers be informed about it?
2. Do we split `BlogPost` in a blog header and a blog body like done for private and forum messages?Milestone DTorsten GroteTorsten Grotehttps://code.briarproject.org/briar/briar/-/issues/403Blog Sharing Client Implementation2018-04-16T16:24:37ZTorsten GroteBlog Sharing Client ImplementationA [BSP](https://code.briarproject.org/akwizgran/briar/wikis/BSP) Client similar to the `ForumSharingManager` should be written that allows the user to
* invite contacts to a blog
* respond to incoming invitations to blogs
* get all b...A [BSP](https://code.briarproject.org/akwizgran/briar/wikis/BSP) Client similar to the `ForumSharingManager` should be written that allows the user to
* invite contacts to a blog
* respond to incoming invitations to blogs
* get all blog invitations related to one contact to be shown in the UI (private conversations?)
* get all blogs the user has been invited, but not responded to - to be shown in the UI
* inform invited contacts that the blog was left/removed
Here's an initial sketch of how the interface could look like:
```java
ClientId getClientId();
void sendBlogInvitation(Blog b, ContactId contactId, String message) throws DbException;
void respondToInvitation(Blog b, ContactId contactId, boolean accept) throws DbException;
Collection<BlogInvitationMessage> getBlogInvitationMessages(ContactId contactId) throws DbException;
Collection<Blog> getAvailableBlogs() throws DbException;
```Milestone Dhttps://code.briarproject.org/briar/briar/-/issues/404Create a Blog Factory2018-06-12T11:32:27ZTorsten GroteCreate a Blog FactoryBoth, the Blog Client (#402) and the Blog Sharing Client (#403) will need to construct blogs. Create a `BlogFactory` that can be used by both.
A blog is one group. The group descriptor of a blog is a BDF list with two elements: name (...Both, the Blog Client (#402) and the Blog Sharing Client (#403) will need to construct blogs. Create a `BlogFactory` that can be used by both.
A blog is one group. The group descriptor of a blog is a BDF list with two elements: name (string) and public_key (raw).Milestone DTorsten GroteTorsten Grotehttps://code.briarproject.org/briar/briar/-/issues/409Blog Fragment in Navigation Drawer with Tabs2018-06-12T11:32:27ZTorsten GroteBlog Fragment in Navigation Drawer with TabsThis ticket is for adding a new fragment to the navigation drawer that holds a [TabLayout](https://developer.android.com/reference/android/support/design/widget/TabLayout.html). Each tab should be able to hold a child fragment. Swiping l...This ticket is for adding a new fragment to the navigation drawer that holds a [TabLayout](https://developer.android.com/reference/android/support/design/widget/TabLayout.html). Each tab should be able to hold a child fragment. Swiping left/right in the child fragment should switch the tab. Clicking on the tab should switch to the respective fragment.
Creating the child fragments with content is **not** part of this ticket.
![Navigation Drawer](https://code.briarproject.org/akwizgran/briar/uploads/342b38ffb0991760da0d2a03beaf42f9/navidrawer_new_blogs.jpg)
![Blogs_5_tab_feed](/uploads/0025186abf95bccf235827d03d3636c3/Blogs_5_tab_feed.jpg)
Update: just added a mockup with a tab indicator
Milestone DTorsten GroteTorsten Grotehttps://code.briarproject.org/briar/briar/-/issues/410My Blogs tab with option to add new blogs2018-06-12T11:32:26ZTorsten GroteMy Blogs tab with option to add new blogsThis tickets depends and builds on #409. A tab "My Blogs" should be created that shows a list of the user's own blogs. There should be a button in the toolbar to add a new blog with a name and a description.
![410-adding-post](/upload...This tickets depends and builds on #409. A tab "My Blogs" should be created that shows a list of the user's own blogs. There should be a button in the toolbar to add a new blog with a name and a description.
![410-adding-post](/uploads/8d87c65e6c5a47aec784fe6374b64dee/410-adding-post.jpg)
1. the user wants to start a new blog and taps the + icon
2. she composes a title (check for max number of characters)
3. and a description (check for max number of characters)
4. the new empty blog is added to the "My blogs" list. Blogs are sorted by creation time by default. But they can also be sorted sorted alphabetically and by date of latest post.
We could of course combine steps (2) and (3).
![Combined](https://code.briarproject.org/akwizgran/briar/uploads/1b37a8ece05ea4b8f11b214a38b9f5b5/Add_new_blog_2_in_1.jpg)
Sort order:
always put the last blog the user interacted with (create, edit, post) on top
Milestone DTorsten GroteTorsten Grotehttps://code.briarproject.org/briar/briar/-/issues/411UI for creating new Blog Posts2018-06-12T11:32:26ZTorsten GroteUI for creating new Blog PostsThis ticket depends on #410.
![new_blog_new_post](/uploads/ace1431ea4b716f2b3fd0447498a125a/composer_flow.jpg)
There are two patterns: Compose in a distinct screen (like it is shown above) or just open keyboard and input field (li...This ticket depends on #410.
![new_blog_new_post](/uploads/ace1431ea4b716f2b3fd0447498a125a/composer_flow.jpg)
There are two patterns: Compose in a distinct screen (like it is shown above) or just open keyboard and input field (like in private messages and forums). We planned to use the distinct screen for the blog feature before we changed it to micro blogs. I'm still a fan of this pattern, but maybe it is of higher importance for the user to still see the feed now that we offer the microblog. Open for suggestions.Milestone DTorsten GroteTorsten Grotehttps://code.briarproject.org/briar/briar/-/issues/417Combined Blog Feed2018-06-12T11:32:26ZTorsten GroteCombined Blog FeedThis ticket depends on #409 and would be implemented after #413 is complete.
![Blogs_5_tab_feed](/uploads/591e095406a64d8d2215ab223cc5bca8/Micro_blog_feed_with_chat_option.png)
This ticket depends on #409 and would be implemented after #413 is complete.
![Blogs_5_tab_feed](/uploads/591e095406a64d8d2215ab223cc5bca8/Micro_blog_feed_with_chat_option.png)
Milestone DTorsten GroteTorsten Grotehttps://code.briarproject.org/briar/briar/-/issues/418UI for Deleting a Blog2018-01-28T11:30:28ZTorsten GroteUI for Deleting a BlogThis ticket depends on #410.
The code should prepare for multiple blogs being deleted in one go. The selection of multiple blogs and triggering the deletion action will be done in ticket #419.
![delete_flow](/uploads/9a44fc79fa0c5...This ticket depends on #410.
The code should prepare for multiple blogs being deleted in one go. The selection of multiple blogs and triggering the deletion action will be done in ticket #419.
![delete_flow](/uploads/9a44fc79fa0c59a8936a877cdea98787/delete_flow.jpg)
(1) hide delete behind the overflow to minimize accidental deletion
(2) + (3) show a message that makes the delete consequences obvious
There is an additional way to delete directly from the list. It has the advantage that multiple deletions are possible:
(4) long tap on a blog...
(5) highlights the entry and changes the app bar. Another long tap...
(6) selects a second entry, so the user can delete or share multiple blogs
Image update: now with tab indicatorsMilestone DTorsten GroteTorsten Grotehttps://code.briarproject.org/briar/briar/-/issues/423Forum code re-factor2018-06-12T11:32:26ZErnir ErlingssonForum code re-factor* Remove redundancy in nested for-loops
* Use `NO_POSITION` instead of -1 when applicable
* Some comments have improper indenting
* Make sure that `position` is not directly in `onBindViewHolder`* Remove redundancy in nested for-loops
* Use `NO_POSITION` instead of -1 when applicable
* Some comments have improper indenting
* Make sure that `position` is not directly in `onBindViewHolder`Milestone Dhttps://code.briarproject.org/briar/briar/-/issues/424Forum post timestamps2018-06-12T11:32:26ZErnir ErlingssonForum post timestampsThere was some old logic upon forum post creation that I didn't quite understand:
`// Don't use an earlier timestamp than the newest post`
Find out what this is about and make appropriate changes if anyThere was some old logic upon forum post creation that I didn't quite understand:
`// Don't use an earlier timestamp than the newest post`
Find out what this is about and make appropriate changes if anyMilestone Dhttps://code.briarproject.org/briar/briar/-/issues/425Forum Event race-condition2018-06-12T11:32:26ZErnir ErlingssonForum Event race-conditionCurrently there exists a race condition in the event handler when new forum messages are received.
Note that this is related to #310 Currently there exists a race condition in the event handler when new forum messages are received.
Note that this is related to #310 https://code.briarproject.org/briar/briar/-/issues/426Forum improvements2018-06-12T11:32:26ZErnir ErlingssonForum improvements* Orientation changes should maintain the state of thread closures and text input
* clickable snack bar when applicable
* bottom divider should not be visible* Orientation changes should maintain the state of thread closures and text input
* clickable snack bar when applicable
* bottom divider should not be visibleMilestone Dhttps://code.briarproject.org/briar/briar/-/issues/427Loading authors2018-06-12T11:32:26ZErnir ErlingssonLoading authorsCurrently, in the forum, the author is loaded like this.
```
private void loadAuthor() throws DbException {
Collection<LocalAuthor> localAuthors =
identityManager.getLocalAuthors();
for (LocalAuthor author : localAuth...Currently, in the forum, the author is loaded like this.
```
private void loadAuthor() throws DbException {
Collection<LocalAuthor> localAuthors =
identityManager.getLocalAuthors();
for (LocalAuthor author : localAuthors) {
if (author == null)
continue;
data.setLocalAuthor(author);
break;
}
}
```
This follows the assumption that the first author (with a null safety check) is the correct author.
* Am I right to assume that we are following a single author scheme at the moment?
* Shouldn't we load up the author once, after login, and then just re-use that instance throughout the app ? Heck, we could even inject it.Milestone Fhttps://code.briarproject.org/briar/briar/-/issues/428Blog Post Activity2018-06-12T11:32:26ZTorsten GroteBlog Post ActivityThis ticket depends on #410 and #415.
When tapping on a long blog post, the post should open up in a dedicated activity. This activity should be implemented here.
![list_of_posts_-_post_overview](/uploads/3d1e667760f502a117211d6d3e...This ticket depends on #410 and #415.
When tapping on a long blog post, the post should open up in a dedicated activity. This activity should be implemented here.
![list_of_posts_-_post_overview](/uploads/3d1e667760f502a117211d6d3e9b1836/list_of_posts_-_post_overview.jpg)
The overflow menu hides the delete option (see #418)Milestone DTorsten GroteTorsten Grotehttps://code.briarproject.org/briar/briar/-/issues/435Generalise ForumSharingIntegrationTest2020-11-21T18:58:09Zstr4dGeneralise ForumSharingIntegrationTestAs part of #403, `ForumSharingManager` was generalised into a `SharingManager` that is subclassed per-shareable.
`ForumSharingIntegrationTest` should be similarly generalised to ensure that the common behaviour is consistent across all ...As part of #403, `ForumSharingManager` was generalised into a `SharingManager` that is subclassed per-shareable.
`ForumSharingIntegrationTest` should be similarly generalised to ensure that the common behaviour is consistent across all subclasses (and to reduce duplication).https://code.briarproject.org/briar/briar/-/issues/436Automatic Personal Blogs2018-06-12T11:32:26ZTorsten GroteAutomatic Personal BlogsAll users should have a blog by default and automatically subscribe to the default blog of their contacts. The blogs of the contacts should show up in the combined feed (#417). Writing a new post into the default blog should be quick an...All users should have a blog by default and automatically subscribe to the default blog of their contacts. The blogs of the contacts should show up in the combined feed (#417). Writing a new post into the default blog should be quick and easy.
As for other blogs, the group descriptor is a BDF list with three elements: `name` (string), `author_name` (string) and the author's long-term `public_key` (raw). The name should be a deterministic identifier that is either known beforehand or can be calculated from the given information. I would suggest to not use "$author_name's blog" as the internal name to allow for localization. The name could be something like "org.briaproject.BLOG_NAME" which will be shown as "$Author's blog" in an English UI.
This is a sub-ticket of #134.Milestone DTorsten GroteTorsten Grotehttps://code.briarproject.org/briar/briar/-/issues/438Extract general means for loading body content in background2020-11-21T18:56:48Zstr4dExtract general means for loading body content in backgroundPer [this comment](https://code.briarproject.org/akwizgran/briar/merge_requests/209#note_6830):
> Fetching content is also needed for blogs and I think also forums. Maybe there's a way to somehow generalize this either further so it can...Per [this comment](https://code.briarproject.org/akwizgran/briar/merge_requests/209#note_6830):
> Fetching content is also needed for blogs and I think also forums. Maybe there's a way to somehow generalize this either further so it can be reused by other clients as well.https://code.briarproject.org/briar/briar/-/issues/439Compare TRVE Data with BSP2020-11-21T18:55:43Zstr4dCompare TRVE Data with BSPFrom the research team we are talking with about performance / battery life measurements (for #115). It sounds like it has a lot of overlap with BSP; it would be interesting to know in what ways the approaches differ.
http://www.cl.cam....From the research team we are talking with about performance / battery life measurements (for #115). It sounds like it has a lot of overlap with BSP; it would be interesting to know in what ways the approaches differ.
http://www.cl.cam.ac.uk/research/dtg/trve/
https://github.com/trvedatahttps://code.briarproject.org/briar/briar/-/issues/448Make use of Existing Translations2018-06-12T11:32:25ZTorsten GroteMake use of Existing TranslationsAdd the existing translations to the source code repo and set up transifex, so they can be pulled in the future like so:
```bash
cd briar-android
tx pull --mode=developer
```Add the existing translations to the source code repo and set up transifex, so they can be pulled in the future like so:
```bash
cd briar-android
tx pull --mode=developer
```Milestone DTorsten GroteTorsten Grote