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
Fix Contacts Item always beeing selected if Back is pressed in the NavMenu
Signed-off-by: goapunk <noobie@goapunks.net>
Closes#782
See merge request !438
Make navigation drawer scrollable

Closes#666
See merge request !432
Use uuid created from the commitment/payload instead of the uuid returned from getUuid()
Signed-off-by: goapunk <noobie@goapunks.net>
Closes#774
See merge request !435
Make original author look like commenter when reblogged
This wasn't as simple as changing the persona in the XML,
because the same layout is used for a post whether reblogged or not.
So the persona needs to be changed programmatically for reblogged posts.
For this, the `AuthorView#setPersona()` method has been made public and
was changed to always set all views into the desired state to support
usage in a RecyclerView.

Closes#639
See merge request !426
make TextInputView resizable again
* TextInputView can resize up to 3 lines again
Signed-off-by: goapunk <noobie@goapunks.net>
Closes#762
See merge request !425
Require a label for signing
This adds a sign() and a verify() method to the CryptoComponent
that take a mandatory label argument to ensure that signatures can't be
repurposed.
Closes#549
See merge request !419
Add visibility information to group member list

Closes#754
See merge request !418
use SHOW_IMPLICIT when showing the softkeyboard, otherwise it won't auto hide
* remove the forced hiding in ThreadListActivity as it should no longer be required
Signed-off-by: goapunk <noobie@goapunks.net>
Closes#761
See merge request !421
Activity module refactor
Broke the Activity module into numerous modules to be able to make numerous controller's package visible
Closes#752
See merge request !417
Do not track incoming positive introduction responses
Positive introduction responses are not shown in the UI (for introducees) and are therefore not marked as read. If they would be tracked, the unread message count would be higher than it actually is and would never decrease.
This is a minimal fix that could be better, but I didn't bother to refactor anything, because we need to rewrite the introduction client eventually anyway once more.
Closes#759
See merge request !416
Add third group visibility state
This branch adds a third group visibility state: each group is either invisible, visible, or shared with respect to each contact.
Invisible means that the contact doesn't see any sign that we subscribe to the group. Visible means that the contact can send us messages in the group, but we won't send the contact messages in the group. Shared means that the contact can send us messages in the group and we'll send the contact any shared messages in the group.
This is a preparatory step for #756. I'll put up another MR with the changes that close that ticket.
See merge request !410
Add visibility and OPTIONS button to private group join notices


Closes#732
See merge request !408
Made private group timestamp greater than that of latest message
I did not change `getPreviousMsgId()` to `getPreviousMsgHeader()` because there doesn't seem to be a need for it anymore.
Closes#755
See merge request !409
Add onboarding dialog for revealing contacts screen
This MR is based on !406.

See merge request !407
Add UI for revealing contacts within a private group
This addresses one part of #732. Join notices and onboarding will follow in separate MRs.
Although this MR is technically not based on !402, it does require it to be merged first to compile.

See merge request !406
Mark relationship visible when syncing group with peer
This branch updates the private group invitation protocol to use @grote's new method for marking a contact relationship visible to the group.
I've changed the method slightly because the protocol state machine allows us to leave and re-enter the BOTH_JOINED state (see diagram on #659), so the relationship may already be visible when the method is called. In that case the visibility isn't updated, so we stick with whichever of revealed-by-us and revealed-by-contact happened first.
See merge request !402
Prepare UI for revealing contacts
This changes the visibility of some methods (that need to be accessed from another package), removes unnecessary abstractions and fixes erroneous static import of GroupId constant.
See merge request !404
Add new Exception handler
While working on #732 I again needed to use a `UiResultExceptionHandler` when I actually don't need to return a result. We have some other places in the code like this. So I introduced a `UiExceptionHandler` without the result part and used it where appropriate. While I was touching some classes, I also added the new annotations.
This MR includes another small commit that notifies only on local group messages. Joining a group is a message as well and without this change, you are notified about a new message when you yourself joined your newly created group.
See merge request !403
Add support for revealing contacts to the PrivateGroupManager
This also adds three integration tests and improves some small details here and there in the private group client.
Prerequisite for #732.
See merge request !396