Store invitation outcome in metadata and make it available to the UI
This MR is based on !479 and should only be merged after that one has been merged as well.
It stores the invitation outcome in the message metadata and includes it in the `canBeOpened()` calculation for private groups and sharables.
Closes#877
See merge request !480
Migrate blog sharing to new sharing client infrastructure
This MR contains a second small commit that fixes#816 and adds a test for it.
Closes#476, #701
See merge request !479
Check the blog item in NavDrawer when opening a blog via notification
There are three scenarios where the selected item in the NavDrawer changes:
1. The user selects an item -> the item is checked automatically.
2. The user pressed back -> already handled in onBackPressed (needs to be extended with #606)
3. The user touched a notification -> handled by this commit.
Signed-off-by: goapunk <noobie@goapunks.net>
Closes#889
See merge request !481
Stop periodic list update only once
When testing the forum unread code, I noticed the recycler view is detaching twice. Once because the stop method is called and once because the view detaches from the window. Wouldn't it be safe to null the refresher when the updates are stopped?
See merge request !478
Threaded Unread Handling

This leaves in the collapsing code for now and just hides the UI element for collapsing. The code can be removed in a second pass to simplify the adapter.
Closes#879
See merge request !476
Fix memory leaks caused by periodic view refreshing tasks
This branch implements @goapunk's suggested solution to #851. Credit goes to @ernir for finding the bug and the initial solution, and @goapunk for the improved solution - I just did a quick implementation so we can get this fixed as quickly as possible.
Closes#851
See merge request !473
Make sure contact name is initialized when needed
This uses a Listenable Future and unfortunately requires 4 basically identical methods to handle the incoming events. Any suggestions for improving that are welcome.
Closes#710
See merge request !472
Add a handleDbException() method to BaseActivity
This adds a `handleDbException()` method to BaseActivity and a corresponding method for fragments that calls through to the activity.
For now, the method just finishes the activity
and NavDrawerActivity overrides it to do nothing,
and all the error places marked with TODO that finish the activity call the method instead.
That gives us zero functional improvement over the status quo,
but it allows us to change the default behaviour easily,
and then we can start thinking about which cases should have non-default behaviour.
First part of #469
See merge request !469
Ignore QR code results until local QR code is created
* Make scanning only possible after we are "ready" (= our QrCode was created and set).
Signed-off-by: goapunk <noobie@goapunks.net>
Closes#814
See merge request !454
Update all logos
The launcher icons are now in mipmap folders which is the recommended practice, because on a low-res device, the high res drawables are stripped from the app. This is bad when the user decides to show the app icons really big on the launcher and the high-res drawables are not available anymore.
The old launcher icon seemed to have some sort of 3D effect.

Navigation Drawer Old:

Navigation Drawer New:

Closes#828
See merge request !459
Use different notification icons for different features


Closes#795
See merge request !460
Plugins throw exceptions for startup errors
Please review carefully as I don't know much about the code I have touched here.
Closes#285
See merge request !462
Move all unit tests to their modules and remove briar-tests
There are now tests in these modules:
* bramble-api
* bramble-core
* bramble-j2se
* briar-core
* briar-android
In order to run all -core tests together, the following AS run configuration can be used:

Closes#778
See merge request !456
Add sharing information to private group ActionBar subtitle

Closes#646
See merge request !455
Add blog sharing information to toolbar subtitle
This MR introduces a new `SharingController` which is supposed to be used in activities that show blogs, groups and forums. Feedback on this approach is welcome before this is used to add "Shared with" support to other parts of the UI.
The toolbar subtitle shows information about how many contacts the current shareable is shared with and how many of those are online.
So far this is implemented for blogs:

One part of #646
See merge request !447
Introduce Dialog Theme for Onboarding
Currently onboarding dialogs and confirmation dialogs look the same. This MR introduces a new dialog theme for onboarding dialogs that looks like the tap target onboarding, so that the user can immediately spot the purpose of the dialog.

See merge request !446
Require a label for hashing
* Add a string label argument to `CryptoComponent#hash()`
* Convert `DoubleDigest` from implementing `MessageDigest`
to implementing `org.spongycastle.crypto.Digest`
(we need to keep `DoubleDigest` for `FortunaGenerator`)
* Convert all other uses of `MessageDigest` to `CryptoComponent#hash()`
* Remove `CryptoComponent#getMessageDigest()`, `MessageDigest` and `DigestWrapper`
Closes#548
See merge request !442
Remove blog pagers
I set out to fix potential race conditions in the blog pagers (the screens you reach by tapping the body of a blog post, that allow you to swipe left and right through the posts in the combined feed or a single blog). The race conditions here are similar to those addressed by !356, but the adapters don't inherit from BriarAdapter so they need to be fixed separately.
While I was looking into this I found a few minor problems with the pagers:
* The feed pager wasn't responding to events - this was fixed in !398
* The feed pager finishes NavDrawerActivity when any blog is removed
* The feed isn't updated when a blog is added (this applies to the list view as well as the pager)
* Posts aren't removed from the feed pager when a blog is removed
The last problem is quite serious - the feed pager's adapter contains posts that are no longer in the DB, so they'll fail to load. To fix that problem, the adapter needs to be cleared in onStop() and repopulated in onStart(). This is the same approach we use for other adapters where items can be removed from the underlying dataset. Unfortunately, FragmentStatePagerAdapter has some odd behaviour when you clear and repopulate it:
1. When reselecting the previously selected item after clearing and repopulating the adapter, the item slides into view instead of just appearing, which makes it look like you've accidentally swiped.
2. Items are sometimes duplicated when clearing and repopulating the adapter, so swiping left or right shows another copy of the same post.
These problems only seem to happen if the adapter is cleared - adding new posts works fine on master, although I think there might be some luck involved - FragmentStatePagerAdapter doesn't seem to be designed to support items changing positions.
I spent a lot of time trying to resolve these problems before concluding that maybe it wasn't worth it, and we should just remove the pagers. That's what's currently implemented in this branch. Tapping the body of a post will show the full-length post, but you won't be able to swipe left or right.
The swiping functionality was nice to have, so if you have ideas for fixing the bugs I'd love to hear them. But I'd rather remove this functionality than keep it in a buggy state with no plan for how to fix it.
Closes#705
See merge request !400
Add integration tests for GroupInvitationManager
This MR is based on !433. It adds some integration tests for the private group invitation protocol. One of those tests fails at the moment.
It does not yet cover all corner cases, so it does not fully address #760, but addresses a part of it. Suggestions for more scenarios to test are welcome.
[Wording changed to prevent #760 from being closed automatically based on the description.]
See merge request !434
Refactor Integration Tests
This is quite a massive MR (currently 1763 additions and 3482 deletions). However, there's not so much happening. The only thing I did was moving redundant code from the various protocol integration tests to the `BriarIntegrationTest` class.
All integration tests are still passing.
Closes#727
See merge request !433