Commit Graph

2363 Commits

Author SHA1 Message Date
Torsten Grote
4d3a333915 Make use of Existing Translations
Adds first translations to source code and sets up transifex config
file. Pull more translations later with:

 cd briar-android
 tx pull --mode=developer

Closes #448
2016-06-27 11:31:42 -03:00
Torsten Grote
4176f592df Merge branch '436-automatic-personal-blogs-backend' into 'master'
Backend for Automatic Micro Blogs

This MR introduces automatic personal blogs to the Blog client. When a contact is added, her personal blog will also be added automatically. Also, when a new identity is added, a personal blog for that identity is created.

The first commit changes the blog paradigm to short-form blogs and introduces other things that will be useful later in the UI (!214) such as a BlogPostAdded event and the possibility to delete/remove blogs (not the personal ones).

This MR is based on !224 to prevent crashes that are fixed by it. So please review and merge !224 first.

See merge request !223
2016-06-23 15:05:46 +00:00
Torsten Grote
91aa81041e Store and expose time a blog post was received
This is useful when sorting blog posts in the combined feed. It ensures
you do not miss older posts that were just synced to you.
2016-06-23 11:58:25 -03:00
Torsten Grote
a8f51fcb8a Backend for Automatic Personal Blogs
When a contact is added, her personal blog will also be added automatically.
Also, when a new identity is added, a personal blog for that identity is created.

Part of #436
2016-06-23 11:58:25 -03:00
Torsten Grote
30fe9f6e2a Change Blog Paradigm to Short-Form
Removes teaser and makes body mandatory.

It also adds support for deleting blogs and
introduces a getAuthorStatus() method to the IdentityManager
that takes a running transaction.
2016-06-23 10:47:44 -03:00
str4d
5a9615265e Merge branch '441-group-descriptor-can-be-too-long-causes-crash' into 'master'
Remove MAX_GROUP_DESCRIPTOR_LENGTH

Closes #441

See merge request !224
2016-06-23 09:27:48 +00:00
Torsten Grote
59320f02b7 Remove MAX_GROUP_DESCRIPTOR_LENGTH
Closes #441
2016-06-22 11:47:38 -03:00
Torsten Grote
3e4be038f2 Merge branch '426-forum-improvements' into 'master'
Forum improvements

Forum Activity improvements:

* Orientation changes now restore the activity properly, e.g. input text and state is retained
* Snack bar is now, when appropriate, clickable
* The bottom divider is no longer visible for the bottom entry
* Code refactoring for improved simplicity and less redundancy
* Timestamp check to ensure that new posts are not older than the latest post

Closes #426 
Closes #423 
Closes #424 

See merge request !218
2016-06-22 14:45:44 +00:00
Ernir Erlingsson
a2a5b746c5 Forum improvements 2016-06-22 13:50:12 +02:00
Torsten Grote
08cc5500ef Merge branch 'nav-drawer-instance-restore-fix' into 'master'
Fixing fragment instance restore

Alas, it turns out that my neat way of integrating the Fragments into the dependency graph was not without problems. Me and @grote discovered that this presented us with a lot of problems on orientation changes as the Activity is re-created, and therefore parts of the dependency graph. The simplest solution was simply to abandon the idea, i.e. with this branch Fragments are no longer part of the dependency graph. 

See merge request !215
2016-06-21 13:59:56 +00:00
Torsten Grote
ee0c4c07a7 Merge branch '354-private-chat-input-field' into 'master'
synched conversation and forum input

Closes #354

See merge request !219
2016-06-21 12:10:35 +00:00
Ernir Erlingsson
ac8c1c0eee synched conversation and forum input 2016-06-21 13:47:33 +02:00
Ernir Erlingsson
8a29207bd0 Fixing fragment instance restore 2016-06-20 21:56:50 +02:00
Torsten Grote
192ee41600 Merge branch '403-blog-sharing-client' into 'master'
Implement Blog Sharing Client

Closes #403

See merge request !220
2016-06-20 17:16:45 +00:00
str4d
13e3eec6b3 Implement BlogSharingManager 2016-06-18 19:02:52 +12:00
str4d
9ae64124d3 Factor out generic sharing code from ForumSharingManger 2016-06-18 19:02:48 +12:00
Ernir Erlingsson
5df2776dc2 Merge branch '78-fix-test' into 'master'
Fix test broken by #78



See merge request !221
2016-06-17 08:31:35 +00:00
str4d
19fdf3ffd0 Fix test broken by #78 2016-06-17 04:48:13 +00:00
Ernir Erlingsson
e7dce02709 Merge branch '402-blog-client-implementation' into 'master'
Blog Client with Factories and Validator

This implements a simple initial blog client that covers the basic blog actions, but no deletion/removal of blogs, yet.

Classes for Blogs and Blog Post Headers have been introduced along with the associated factories.

A `BlogPostValidator` has been added that validates incoming blog posts.

Closes #402
Closes #404

See merge request !212
2016-06-15 20:26:35 +00:00
Ernir Erlingsson
f823b8ba4c Merge branch '78-trust-indicators' into '402-blog-client-implementation'
New Trust Level Indicator Replaces The Stars

This implements a generic `TrustIndicatorView` with a `setTrustLevel()`
method which updates the drawable according to the `Author.State`.

It also removes unused files from the repo.

This is based on !212 and should only be merged after it.

Closes #78

See merge request !217
2016-06-15 20:17:59 +00:00
Torsten Grote
dc048187f5 New Trust Level Indicator Replaces The Stars
This implements a generic `TrustIndicatorView` with a `setTrustLevel()`
method which updates the drawable according to the `Author.State`.

Closes #78
2016-06-15 12:41:43 -03:00
Torsten Grote
da68ef78f1 Blog Client with Factory and Validator
This implements a simple initial blog client that covers the basic blog
actions, but no deletion/removal of blogs, yet.

Classes for Blogs and Blog Post Headers have been introduced along with
the associated factories.

A `BlogPostValidator` has been added that validates incoming blog posts.

Closes #402
Closes #404
2016-06-15 11:16:28 -03:00
Torsten Grote
bbed673150 Merge branch '433-forum-persistance' into 'master'
fix persistance

Closes #433

See merge request !216
2016-06-15 14:11:42 +00:00
Ernir Erlingsson
69b0bec033 fix persistance 2016-06-14 23:53:05 +02:00
str4d
a11e30c2b3 Merge branch '390-change-password' into 'master'
Add a UI for changing the password

Closes #390

See merge request !213
2016-06-11 22:51:24 +00:00
str4d
c5708ee3ce Add a UI for changing the password 2016-06-11 22:49:45 +00:00
Torsten Grote
e96838e731 Merge branch '430-npe-in-forumsharingstatusactivity' into 'master'
Fix NPE in ForumSharingStatusActivity by only accessing group in contact list

Only access group in contact list where it is guaranteed to exist.

Closes #430

See merge request !211
2016-06-08 13:49:09 +00:00
Torsten Grote
6697b06530 Fix NPE in ForumSharingStatusActivity
by checking if a group ID exists.

Closes #430
2016-06-08 10:47:47 -03:00
Torsten Grote
1bb17a3979 Merge branch '309-client-layer-events-for-messaging' into 'master'
Client layer events for messaging

Adds and uses a new `PrivateMessageReceivedEvent` and eliminate the need for an event for adding local messages. Both done in separate commits.

This addresses part of #309

See merge request !208
2016-06-08 13:37:34 +00:00
Torsten Grote
9d826631e9 Add private message to list right away, so eliminate need for an event 2016-06-08 10:31:26 -03:00
Torsten Grote
b26acdf228 Introduce a PrivateMessageReceivedEvent and use it in the Android app 2016-06-08 10:31:26 -03:00
Torsten Grote
69fba1aa17 Merge branch '388-forum-sharing-race-condition' into 'master'
Address Race-Condition in Forum Sharing

When Two Contacts Share Same Forum with each other at the same time a race condition causes them both to delete each other's invitation. This is solved by an Alice/Bob test as suggested in #388.

See merge request !205
2016-06-08 13:29:12 +00:00
Torsten Grote
1a1dd80810 Merge branch '408-forum-list-unread-posts-badges' into 'master'
Adds badges to the forum list that indicate unread posts

This MR adds  badges to the forum list that indicate unread posts. It does so by extending the compound view `TextAvatarView` and provides convenient setters that take care of the required UI changes. The new badge can also be used to indicate a problem with the forum.

![device-2016-06-02-134048](/uploads/133f365f5654be304f590a4f5b667d06/device-2016-06-02-134048.png)![device-2016-06-02-134453](/uploads/423a88f6306a558828181f0c539aa1cb/device-2016-06-02-134453.png)

I decided not to check if the forum is shared from someone or with someone and indicate a problem in this case, because this requires iterating two times over all contacts and their group metadata for each forum. If someone considers it important to check for this information, we can create a ticket for doing this within the forum and not in the forum list.

See merge request !207
2016-06-07 14:36:42 +00:00
Ernir Erlingsson
02f432c04e Merge branch '409-blog-fragment-in-navigation-drawer-with-tabs' into 'master'
Blog Fragment in Navigation Drawer with Tabs

This replaces the custom layouts in the navigation drawer with a
`NavigationView` and adds a menu entry for Blogs.

A Main Blogs fragment is added that holds a `TabLayout` and a
`ViewPager`. Five tabs are already added, but they just have a single
placeholder fragment that is to be replaced by the actual fragments.

Please note that the header in the navigation drawer is just provisional. I am sure @Megalox can design a better one.

![device-2016-06-02-191101](/uploads/ddffee792f67fad01158d7adc7ca904d/device-2016-06-02-191101.png)
![device-2016-06-02-191048](/uploads/a5e6def118646a02c6bcbf17e0398484/device-2016-06-02-191048.png)

Closes #409

See merge request !210
2016-06-06 09:48:08 +00:00
Torsten Grote
3f838b0472 Blog Fragment in Navigation Drawer with Tabs
This replaces the custom layouts in the navigation drawer with a
`NavigationView` and adds a menu entry for Blogs.

A Main Blogs fragment is added that holds a `TabLayout` and a
`ViewPager`. Five tabs are already added, but they just have a single
placeholder fragment that is to be replaced by the actual fragments.

Closes #409
2016-06-03 13:51:31 -03:00
Torsten Grote
5d06f42000 This commit adds badges to the forum list that indicate unread posts.
It does so by extending the compound view `TextAvatarView` and provides
convienient setters that take care of the required UI changes.
The new badge can also be used to indicate a problem with the forum.

Closes #408
2016-06-03 12:44:03 -03:00
Torsten Grote
4acb59b22a Address Race-Condition when Two Contacts Share Same Forum
with each other at the same time.

Closes #388
2016-06-02 14:02:32 -03:00
str4d
bba7083660 Merge branch '422-forum-subtree-duplicates' into 'master'
fixed sub-tree duplicate bug

Closes #422

See merge request !206
2016-06-02 00:27:08 +00:00
Ernir Erlingsson
e3fc015ec3 fixed sub-tree duplicate bug and also wrong reply count 2016-06-01 23:32:19 +02:00
Ernir Erlingsson
441fce8500 fixed forum crash bug 2016-05-31 23:12:33 +02:00
Ernir Erlingsson
a58fb72ab1 Merge branch '122-threaded-discussion-ui' into 'master'
122 threaded discussions

This branch contains the complete code for the nested forums (UI & back-end).

* This branch has an optional randomized set of dummy test data, uncomment one line in ForumActivity.java and then open up any forum.


See merge request !201
2016-05-31 16:06:22 +00:00
Ernir Erlingsson
86039b81c0 Forum, nested discussions front end UI/UX, rev 2 2016-05-30 23:57:01 +02:00
str4d
661140f623 Merge branch '382-message-dependencies-2' into 'master'
Message Dependencies

This MR adds a new table to the database to hold message dependencies.
It introduces two more message states  (pending and delivered) and completely changes the validation and message delivery logic.

Since this is a **very invasive** change, please **review carefully**. It is better to catch issues now than having to debug things later. If you notice an area without tests, please let me know. I tried to have tests for all changes.

Unfortunately, this MR turned out rather large, but most of it are actually tests and you can review one commit after the other without needing to see the full changelog.

In order to reflect the new states, things that were previously true for `VALID` messages have been changed to now be true for `DELIVERED` messages. This might have changed the semantics in some places and can have unindented side-effects.

The `DatabaseComponent` was extended with methods for:
* adding dependencies
* getting dependencies and states of a message
* getting messages that depend on a message (dependents) and their states
* getting messages to be delivered (by startup hook)
* getting pending messages to be possibly delivered (by startup hook)

The `valid` column in the database was renamed to `state` along with the associated methods to better reflect its new extended meaning.

Since pending messages should not be available to clients, many database queries have been modified to only return results for delivered messages. I might have missed some. Please check carefully. Also you might want to think about how you could create arbitrarily large transactions by sending malicious messages.

Please note that the database version was bumped in this MR.

Closes #382

See merge request !198
2016-05-28 00:20:39 +00:00
str4d
19b6afa69f Move new methods in Database interface to match existing alphabetic sorting 2016-05-28 00:17:17 +00:00
str4d
7ac7fae30e Update comments 2016-05-28 00:16:24 +00:00
Torsten Grote
d3b83a50a6 Let the ForumValidator return parent posts as dependency
and add integration tests that make sure that dependencies are handled
properly.
2016-05-26 13:49:59 -03:00
Torsten Grote
5561532c5d Implement new message validation logic
that handles message dependencies reported from clients.

The MessageValidatedEvent has been renamed into a MessageDeliveredEvent
since there were no real use cases for the former any more.
2016-05-26 13:49:59 -03:00
Torsten Grote
b03d0a206b Add Message Dependencies to Database
This adds a new table to the database to hold message dependencies.
It introduces two more message states: pending and delivered
The valid column in the database was renamed to state to better reflect
its new extended meaning.

The DatabaseComponent was extended with three methods for:
* adding dependencies
* getting dependencies of a message
* getting messages that depend on a message (dependents)
* getting messages to be delivered (by startup hook)
* getting pending messages to be possibly delivered (by startup hook)

In order to reflect the new states, things that were previously true for
VALID messages have been changed to now be true for DELIVERED messages.

Since pending messages should not be available to clients, many database
queries have been modified to only return results for delivered
messages.

All added methods and changes should come with updated unit tests.

Please note that the database version was bumped in this commit.
2016-05-26 13:49:03 -03:00
Ernir Erlingsson
512940e82b Merge branch '393-message-tree' into 'master'
Sort threaded messages generic

Constructed a generic that we can use to sort threaded messages.

Closes #393

See merge request !203
2016-05-26 11:13:06 +00:00
Ernir Erlingsson
d2ba7c9b7f generic sorted message tree 2016-05-25 22:12:20 +02:00