Commit Graph

376 Commits

Author SHA1 Message Date
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
b26acdf228 Introduce a PrivateMessageReceivedEvent and use it in the Android app 2016-06-08 10:31:26 -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
d2ba7c9b7f generic sorted message tree 2016-05-25 22:12:20 +02:00
Ernir Erlingsson
21b237a629 ForumManager: Added parent id to metadata and a unit test 2016-05-24 15:12:37 -03:00
str4d
0d16dd0358 Merge branch '382-message-dependencies' into 'master'
Introduce a MessageContext class to be used by all validators

This change will allow to pass message dependencies from the client validators to the `ValidationManager`.

Please see my thoughts in #382 for more details.

See merge request !197
2016-05-20 02:49:04 +00:00
Torsten Grote
3f2b85ac0d Introduce a MessageContext class for more flexibility
This change will allow to pass message dependencies from the client
validators to the ValidationManager.
2016-05-20 02:46:37 +00:00
Torsten Grote
b13bf66165 Add a new activity that shows sharing status of forum
The new activity shows who you are sharing a forum with and who shares a
forum with you. It is accessible from the overflow menu when in a forum.

Closes #398
2016-05-19 11:42:05 -03:00
Torsten Grote
38a4f73cdc Handle invitations to the same forum by multiple contacts
Closes #391
2016-05-19 11:34:28 -03:00
Torsten Grote
bd01c3732e Also use dedicated classes to represent messages instead of BdfDictionary 2016-05-19 11:32:09 -03:00
Torsten Grote
d2722eed92 Turn local session state into its own class instead of BdfDictionary 2016-05-19 11:30:19 -03:00
Torsten Grote
aad9f5142b Extract ForumFactory from ForumManager
The code for creating forums in ForumManager was used by
ForumSharingManager and also needed by InviteeEngine.
This extracts it into its own class.

Closes #375
2016-05-16 16:56:44 -03:00
Ernir Erlingsson
fcf21b7ed7 Merge branch 'gradle-upgrade' into 'master'
Upgrade Gradle to 2.13, add local Maven repo



See merge request !186
2016-05-14 19:22:42 +00:00
akwizgran
f2ab0eff53 Simple metadata queries. #222
Added support for retrieving metadata that matches all key/value pairs in a query.
2016-05-12 17:40:11 +01:00
akwizgran
ec083d617e Upgraded Gradle to 2.13, added local Maven repo. 2016-05-12 13:36:34 +01:00
akwizgran
3193b73687 Merge branch 'start-plugins-async' into 'master'
Start plugins asynchronously

This prevents other services from getting stuck behind the plugin manager while the Tor plugin is starting, which takes several seconds. The plugin manager waits for each plugin to start before stopping it.

I've also added some canaries to plugins and services to ensure instances aren't started more than once.

See merge request !181
2016-05-11 14:46:55 +00:00
akwizgran
3680cad9b8 Merge branch 'poller-refactoring' into 'master'
Poller refactoring, replace Timer with ScheduledExecutorService

* Replace Timer with ScheduledExecutorService (closes #258)
* Move automatic connection logic from PluginManager to Poller
* Reschedule polling when connections are opened or closed, making the poller more responsive to reductions in the polling interval


See merge request !180
2016-05-11 14:45:50 +00:00
akwizgran
1bd5c0b195 Merge branch 'aggressive-polling' into 'master'
Try harder to connect to contacts

* When an outgoing connection is lost, try to reconnect to the contact straight away
* Use periodic polling for Tor, regardless of whether our hidden service descriptor has been published
* Reduce polling intervals for all plugins (this can be reverted if we solve the connectivity issues)

Closes #262, #314. Hopefully helps with #361.

See merge request !177
2016-05-10 14:47:04 +00:00
akwizgran
86f409d0bf Don't send dev reports until transport is enabled. 2016-05-06 12:14:47 +01:00
akwizgran
5044f34ba9 Moved all automatic connection logic into poller. 2016-05-06 12:11:39 +01:00
akwizgran
ff8301521c Replaced Timer with ScheduledExecutorService. #258 2016-05-06 12:11:34 +01:00
akwizgran
dd9bc74262 Try to reconnect on connection loss. #262 2016-05-06 12:07:56 +01:00
Torsten Grote
9bef114c35 Forum Sharing Client backend
This commit replaces the old ForumSharingManagerImpl with a new one
which is based on state machines and the ProtocolEngine.

There is a SharerEngine and a InviteeEngine that take care of state
transitions, messages, events and trigger actions to be carried out by
the ForumSharingManagerImpl. This is all very similar to the
Introduction Client.

The general sharing paradigm has been changed from sharing as a state to
sharing as an action. Now the UI can allow users to invite contacts to
forums. The contacts can accept or decline the invitiation. Also, the
Forum Sharing Manger is notified when users leave a forum.

Closes #322
2016-05-04 17:02:22 -03:00
Torsten Grote
d42b49afc2 Allow to get a forum from the ForumManager within a transaction 2016-05-04 17:02:22 -03:00
Torsten Grote
9f9a216305 Prepare for new Forum Sharing Client
Methods for creating, adding and removing forums have been moved to the
`ForumManager`. In order to still handle removing forums properly, a
`RemoveForumHook` has been introduced.

Methods for sharing forums with all current and future contacts have
been removed along with the localGroup where this information was saved.

The `ShareForumActivity` now has the proper label.

The `SessionId` and the `ProtocolEngine` have been moved to the
`clients` package.

This addresses part of #322 and part of what has been discussed in #320.
2016-05-03 11:48:45 -03:00
akwizgran
1777ab51fb Merge branch '124-encrypted-feedback' into 'master'
Implement encrypted feedback

Closes #124.

See merge request !138
2016-04-29 18:22:53 +00:00
akwizgran
860d06cefa Revert to support library 23.1.1. 2016-04-29 13:40:00 +01:00
str4d
c44b6a4095 Implement encrypted feedback 2016-04-28 16:44:01 +12:00
str4d
f73f0aa4ab Migrate crash reports to ACRA 2016-04-27 22:22:16 +12:00
akwizgran
7779319f9a Merge branch '295-show-declined-introductions' into 'master'
Show relevant introduction decline responses in the conversation

* If the user has already declined, we don't show that the other
  introducee has declined as well. The backend doesn't have that information, so
  this is compatible with the principle of showing what we know.
* If the user has already accepted or hasn't yet responded, we now show the
  decline response in the private conversation with the introducer. If
  the user hasn't yet responded, we hide the accept/decline buttons
  in the introduction request message.

Please note that I do not have three devices at the moment to test this MR in its entirety in practice. I created another test which is hopefully sufficient to ensure that the modifications are correct.

Closes #295 

See merge request !149
2016-04-25 12:07:13 +00:00
akwizgran
9b5d3ecb7a Added public key and placeholder onion address. 2016-04-21 16:07:51 +01:00
Torsten Grote
11e6d64e4d Show relevant decline responses in the conversation
* If the user has already declined, we don't show that the other
  introducee has declined as well. The backend doesn't have that information, so
  this is compatible with the principle of showing what we know.
* If the user has already accepted or hasn't yet responded, we show the
  decline response in the private conversation with the introducer. If
  the user hasn't yet responded, we hide the accept/decline buttons
  in the introduction request message.

Messages an introducee receives in a `FINISHED` state are now being
ignored and deleted.

Closes #295
2016-04-21 11:08:15 -03:00
str4d
5c2f56549b Refactor MessageEncrypter interface to use PublicKey and PrivateKey 2016-04-21 01:08:39 +00:00
str4d
d545aaa892 Encrypt and save crash reports, send them the next time TorPlugin start
Will currently fail at runtime; requires a public key and a server onion.
2016-04-20 23:42:46 +00:00
Torsten Grote
36ef536e82 Integration Tests for Introduction Client
* normal session where both introducees accept
* normal session where the first introducee declines
* normal session where the second introducee declines
* one session where a contact is introduced to herself
* one session where two identities of the same contact
  are introduced to each other

This introduces a new IntroductionAbortedEvent to signal when the
protocol was aborted. It is not yet used in the UI.

It closes #276
2016-04-20 11:35:51 -03:00
Torsten Grote
d0036deaf7 This addresses two types of introduction corner cases:
* force decline when two of our own identities are introduced to each
  other
* throw away introduction requests to the same identity
  (impossible to trigger from UI)

Closes #284
2016-04-20 11:31:54 -03:00
Torsten Grote
d205f3b0d8 Refactor the Introduction Client to avoid circular dependencies
This injects the IntroducerManager and the IntroduceeManger for easier testing
2016-04-14 12:53:22 -03:00
Torsten Grote
c5bfea2155 address issues found in final review
(except refactoring of conversation item classes)
2016-04-12 17:04:52 -03:00
Torsten Grote
90d984ee52 Ensure responses shown after requests, clarify wording, reuse transactions
When devices' clocks are out of sync, it is possible that a response is
shown before the request. This commit makes sure that the timestamp of
responses is always later than the last message in the conversation.

Some wording could be misunderstood to thing introductions were
successful even though they were not. That has been clarified.

A new database transaction was created when getting contacts and local
transport properties. This has been changed to re-use the existing
transaction.

Also addresses minor issues found in review.
2016-04-12 17:04:52 -03:00
Torsten Grote
4b7a32a5ee Find correct session state in case the same one is used twice.
The code made the assumption that a session state can be identified by
the unique session ID. However, when multiple identities from the same
device are involved, there are two sessions with the same ID running on
the device.

Hence, a second identifying criteria has to be used to uniquely identify
the correct session. Here, the ID of the group was chosen.
Unfortunately, the session state can not be cached easily anymore
leading to a small performance penalty when getting all messages for the
UI.
2016-04-12 17:04:52 -03:00
akwizgran
7de83b5624 Removed device ID from transport properties. 2016-04-06 17:12:20 +01:00
akwizgran
befd916eba Connect to newly activated contacts. 2016-04-06 17:10:54 +01:00
Torsten Grote
21bb23ba67 Merge branch '273-service-exceptions' into 'master'
Services should throw exceptions for startup errors

Fixes #273

See merge request !134
2016-04-06 15:51:03 +00:00
akwizgran
b480777548 Services should throw exceptions for startup errors. 2016-04-05 15:44:50 +01:00
akwizgran
2b19e4c8db Close transport connection if tag isn't recognised. #281 2016-04-05 11:37:38 +01:00
akwizgran
945b5eb1ac Create local state for clients at startup. #279 2016-04-01 17:15:35 +01:00
akwizgran
4393517f31 Merge branch '118-contact-introductions' into 'master'
Contact Introduction Backend

This MR allows you to introduce two of your contacts to each other. They both will receive an introduction with an optional message and then can accept or refuse the introduction which is presented as a notification.

When reviewing, I propose to review the individual commits separately as I took great care to split functional independent parts into separate commits. You might also want to have a look at the [Introduction Client Wiki page](https://code.briarproject.org/akwizgran/briar/wikis/IntroductionClient) to better understand what is going on before looking into the actual code.

Protocol sessions and states are not yet deleted and the UI is still missing (#253). In order to practically test this feature, the UI from !122 is needed.

See merge request !116
2016-03-31 11:26:09 +00:00
akwizgran
db6c813522 Merge branch '117-qr-contacts' into 'master'
BQP with QR codes

This MR implements BQP for key agreement over short-range transports. It also implements the Android UI for using BQP with QR codes.

Closes #117.

See merge request !84
2016-03-31 11:21:02 +00:00
Torsten Grote
54f320465f Add information about whether Contact is active to ContactAddedEvent 2016-03-30 13:36:14 -03:00
Torsten Grote
f44cb5ff94 Add an IntroductionManager and Validator
This Introduction BSP Client uses its own group to communicate with
existing contacts. It uses four types of messages to facilitate
introductions: the introduction, the response, the ack and the abort.

The protocol logic is encapsulated in two protocol engines, one for the
introducer and one for the introducee. The introduction client keeps the
local state for each engine, hands messages over to the engines and
processes the result and state changes they return.
2016-03-30 13:36:14 -03:00