Commit Graph

2014 Commits

Author SHA1 Message Date
akwizgran
9e40d0be16 Added placeholder for MessageQueueManagerImpl tests. 2016-03-08 16:28:31 +00:00
akwizgran
efa06527c9 Moved validation interfaces into respective managers. 2016-03-08 16:22:09 +00:00
akwizgran
d308a30d05 Added BdfIncomingMessageHook. 2016-03-08 16:07:36 +00:00
akwizgran
ab7cc13014 Added QueueMessage support to BdfMessageValidator. 2016-03-08 16:07:36 +00:00
akwizgran
a4d6de0340 Added message queue manager. 2016-03-08 16:07:29 +00:00
akwizgran
c9276de399 Renamed validation hooks to incoming message hooks. 2016-03-07 18:36:30 +00:00
Torsten Grote
8960644273 Merge branch 'use-client-helper' into 'master'
Use client helper in existing clients

Use the new ClientHelper to reduce boilerplate in existing clients. Add a BdfMessageValidator superclass for clients that format their messages as BDF lists and their metadata as BDF dictionaries (which all existing clients do).

See merge request !115
2016-03-07 14:47:32 +00:00
akwizgran
88ab694af8 No need to unwrap Bytes before adding to dictionary. 2016-03-04 21:11:25 +00:00
akwizgran
5998412a8a Use ClientHelper in PrivateMessageFactoryImpl. 2016-03-04 21:10:52 +00:00
akwizgran
d342594313 Use ClientHelper in ForumPostFactoryImpl. 2016-03-04 21:10:52 +00:00
akwizgran
cc7ffee28d Superclass for validating messages that are BDF lists. 2016-03-04 21:10:44 +00:00
akwizgran
05ec49e45b Use ClientHelper in TransportPropertyManagerImpl. 2016-03-04 21:07:33 +00:00
akwizgran
9d5924fc24 Use ClientHelper in ForumSharingManagerImpl. 2016-03-04 21:07:33 +00:00
akwizgran
2ccd1dee33 Use ClientHelper in ForumManagerImpl. 2016-03-04 21:07:33 +00:00
akwizgran
8beff5c743 Use ClientHelper in MessagingManagerImpl. 2016-03-04 21:07:33 +00:00
akwizgran
4ddc34ee01 Added new methods to ClientHelper. 2016-03-04 21:07:33 +00:00
akwizgran
5b47d6d3ff Merge branch 'bdf-improvements' into 'master'
BDF improvements

* Change the semantics of the BdfList/Dictionary methods with default values so they return the default value if the value is missing, or throw an exception if it the value's present but has the wrong type - this is more useful for validators, which have to deal with optional values without accepting values of the wrong type
* Reuse BdfReader/Writer for MetadataParser/Encoder so we don't have two implementations of BDF


See merge request !117
2016-03-04 21:06:11 +00:00
akwizgran
db188657ca Reuse BdfReader/Writer for MetadataParser/Encoder. 2016-03-04 21:00:30 +00:00
akwizgran
418798b1f0 Added BdfList/Dictionary getters for optional values. 2016-03-04 21:00:05 +00:00
akwizgran
08099714ba Bumped expiry date to 1 April 2016. 2016-03-02 09:58:23 +00:00
akwizgran
10561a2df3 Added new module to roboguice.xml. 2016-02-29 16:38:55 +00:00
akwizgran
cab94360ec Skip message header when parsing body. 2016-02-29 15:47:56 +00:00
akwizgran
154e95a989 Merge branch 'client-helper' into 'master'
Helper class to reduce client boilerplate

* Renamed BdfReader methods for consistency with BdfList/BdfDictionary
* Added readList() and readDictionary() methods to BdfReader
* Added ClientHelper to reduce boilerplate when converting messages and metadata to and from BDF
* Moved PrivateGroupFactory to the same package as ClientHelper


See merge request !114
2016-02-29 14:37:45 +00:00
akwizgran
75d53598b0 Merge branch 'validation-manager-tests' into 'master'
Unit tests for ValidationManagerImpl

Unit test for the validation manager. I also changed the way the validation manager loads unvalidated messages - instead of using a single DB task to load all unvalidated messages, it loads a list of message IDs and then loads each message in a separate task. This prevents the DatabaseExecutor from being blocked by a long-running task if there are lots of messages to validate.

See merge request !113
2016-02-29 14:35:30 +00:00
akwizgran
34d34a754a Renamed metadata methods. 2016-02-29 14:29:53 +00:00
akwizgran
640f5484e0 Moved PrivateGroupFactory to clients package. 2016-02-29 14:25:29 +00:00
akwizgran
2e7df53dba Added helper class so clients can use less boilerplate. 2016-02-29 14:23:50 +00:00
akwizgran
9e0add7d4c Renamed BdfWriter methods, added support for NULL_VALUE. 2016-02-29 14:23:49 +00:00
akwizgran
3ce62818aa Renamed BdfReader methods, added convenience methods. 2016-02-29 14:23:49 +00:00
Torsten Grote
9dec498e7e Merge branch 'add-contact-transaction' into 'master'
Add contact and transport keys in the same transaction

This avoids a potential problem where the app crashes after adding the contact but before adding the transport keys, leaving the contact unusable.

See merge request !112
2016-02-29 14:07:33 +00:00
akwizgran
e3374b7584 Rename BDF methods. 2016-02-29 11:57:42 +00:00
akwizgran
46e7a52c22 Merge branch 'bdf-type-conversion' into 'master'
Convert BDF types in lists and dictionaries



See merge request !111
2016-02-29 11:55:08 +00:00
akwizgran
5045b58e01 Explicitly check array lengths. 2016-02-29 11:51:16 +00:00
akwizgran
e28dc17881 Helper methods and unit tests for BdfList/Dictionary. 2016-02-26 16:27:24 +00:00
akwizgran
476b1edbad Unit tests for ValidationManagerImpl. 2016-02-26 14:16:25 +00:00
akwizgran
b8cf508b0c Moved ImmediateExecutor out of plugins package. 2016-02-26 14:16:09 +00:00
akwizgran
8ba95a2965 Use a separate DB task for loading each message.
Each task is added to the back of the executor's queue, allowing tasks from other callers to be interleaved.
2016-02-26 14:15:25 +00:00
akwizgran
4e0990d865 Removed unused dependencies from invitation classes. 2016-02-26 11:12:31 +00:00
akwizgran
1d89c6cebc Add contact and transport keys in the same transaction.
This avoids a potential problem where the app crashes after adding the contact but before adding the transport keys, leaving the contact unusable.
2016-02-26 10:57:32 +00:00
akwizgran
76e6b7cfa9 Convert BDF types in lists and dictionaries. 2016-02-26 10:30:50 +00:00
str4d
8c8b2a5358 Merge branch '250-tor-polling' into 'master'
New polling logic for Tor. #250

Poll for outgoing connections each time the network is enabled, then disable polling once our hidden service descriptor has been published. If our contacts do the same, any contacts that are offline when we poll will connect to us when they come online.

This should reduce bandwidth and battery usage. The idea comes from Ricochet:

https://github.com/ricochet-im/ricochet/issues/68

Fixes #250.

See merge request !103
2016-02-25 14:54:49 +00:00
akwizgran
d8079b1841 Fixed race condition in descriptor publication.
If two contacts publish their descriptors simultaneously, they may both stop polling without retrieving each other's descriptors. Continue polling for 2 intervals after publishing the descriptor.
2016-02-25 10:10:57 +00:00
akwizgran
066285b86a New polling logic for Tor. #250
Poll for outgoing connections each time the network is enabled, then disable polling once our hidden service descriptor has been published.
2016-02-25 10:10:57 +00:00
akwizgran
fee4beae63 Merge branch '252-lan-polling' into 'master'
New polling logic for LAN. #252

Same approach as !104. Modified the poller to cancel any scheduled poll when pollNow() is called and randomise the next polling interval so plugins that call pollNow() at the same time don't end up polling in sync.

Depends on !104. Fixes #252.

See merge request !105
2016-02-24 20:11:54 +00:00
akwizgran
d829d4711b Merge branch '251-bluetooth-polling' into 'master'
New polling logic for Bluetooth. #251

Increase the polling interval exponentially each time polling is unsuccessful, up to a maximum of 60 minutes. The interval is reset to 2 minutes whenever a connection is made and whenever Bluetooth is re-enabled.

This should reduce battery usage when there are no contacts nearby.

Fixes #251.

See merge request !104
2016-02-24 20:08:05 +00:00
akwizgran
441b12d936 Merge branch '225-bluetooth-address' into 'master'
Try to use the real Bluetooth address on Android 6. #225

Fixes #225 until Google breaks the Settings.Secure workaround.

See merge request !109
2016-02-24 20:07:05 +00:00
akwizgran
000936b7a2 Return the empty string instead of the fake address. 2016-02-24 20:03:04 +00:00
akwizgran
9789c0ff52 Try to use the real Bluetooth address on Android 6. #225 2016-02-23 11:53:54 +00:00
akwizgran
6b802c2ea0 Merge branch '254-key-rotation-crash' into 'master'
Don't reschedule the same TimerTask. #254

Also added some unit tests for TransportKeyManager (part of #205). Fixes #254.

See merge request !108
2016-02-23 10:36:47 +00:00
akwizgran
681ec080e1 Randomise next polling interval after pollNow(). 2016-02-22 13:25:07 +00:00