Commit Graph

1962 Commits

Author SHA1 Message Date
akwizgran
5ce8927477 New polling logic for LAN (and WAN). #252
Same exponential backoff approach as Bluetooth.
2016-02-22 13:25:07 +00:00
akwizgran
c081c08ff5 New polling logic for Bluetooth. #251
The polling interval increases 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.
2016-02-22 13:21:05 +00:00
akwizgran
a774b3419a Merge branch '117-bytes-comparator' into 'master'
Move UniqueId comparator to Bytes for reuse



See merge request !107
2016-02-19 12:19:35 +00:00
akwizgran
8a20f330be Broadcast status event when active contact is added. 2016-02-19 12:10:44 +00:00
akwizgran
9ad41ea28b Check UTF-8 length of transport ID. 2016-02-19 11:55:40 +00:00
str4d
5a6ab9bb96 Made UniqueId a subclass of Bytes. 2016-02-19 11:55:31 +00:00
akwizgran
0f1dc554bd Merge branch 'embargo-inactive-contacts' into 'master'
Don't communicate with inactive contacts

When we're introduced to a new contact, we need to store the transport keys and start key rotation before activating the contact. During this period we shouldn't use the transport keys for outgoing streams until either the introduction protocol is complete or we receive an incoming stream from the contact, indicating that they've also started key rotation.

See merge request !106
2016-02-18 15:58:05 +00:00
akwizgran
682355fc37 Don't allow outgoing streams to inactive contacts. 2016-02-18 10:29:46 +00:00
akwizgran
b7dc13ab53 Added unit test for setting contact active. 2016-02-18 10:10:12 +00:00
Torsten Grote
81e2d04de6 Merge branch 'message-status-cleanup' into 'master'
Database efficiency improvements

Some tweaks to the DB schema to improve efficiency:

* Only keep status rows for messages that are visible - this saves space and avoids the need to join the groupVisibilities table when selecting messages to offer or send
* Use adjacent columns for the composite primary key on the settings table

This MR depends on !101.

See merge request !102
2016-02-17 19:49:48 +00:00
akwizgran
a6baa5821e Added active flag to contacts. 2016-02-17 18:10:52 +00:00
akwizgran
6b76b75d08 More efficient database joins.
Don't keep message status rows for groups that are invisible to the contact - this avoids the need to join the groupVisibilities table when selecting messages to offer or send. Add or remove status rows when group visibility changes.
2016-02-17 17:24:44 +00:00
akwizgran
e979f17e45 Execute test tasks in a deterministic order. 2016-02-17 17:24:43 +00:00
akwizgran
42c00fb86e Merge branch 'client-transactions' into 'master'
Transactions for clients

This patch moves transactions out of the database component, allowing clients to perform multiple database calls in a single transaction. This should improve efficiency and reliability, at the cost of increased boilerplate for database calls.

Operations that allow hooks, such as adding and removing contacts, pass their transactions to their hooks. This ensures the whole operation is atomic and isolated, so StorageStatus is no longer needed, hooks don't need to be idempotent, and locks can be removed from clients that were using them for isolation.

This merge request is marked WIP because it will conflict with !74.

See merge request !101
2016-02-17 17:24:18 +00:00
akwizgran
00e59613c0 Call validation hooks after storing message & metadata. 2016-02-17 16:51:44 +00:00
akwizgran
f43f79eb5c Merge branch 'identicon-contrast' into 'master'
Increase contrast between identicons and background

Identicons currently have a dark or light background depending on the V component of the foreground colour. But V isn't a great measure of brightness - cyan looks much brighter than blue with the same V, for example. This leads to some identicons having low contrast between the foreground and background.

This patch scales the R, G and B components of the foreground colour to 3/4 of the full range and sets the background to white, so there's always good contrast between the foreground and background. The patch also adds a 1dp outline around identicons and adds some padding to the identity selection dropdown.

Before:
![device-2016-02-10-150200](/uploads/2456ff047d4d33b4537f3489c9018679/device-2016-02-10-150200.png)

After:
![device-2016-02-10-154634](/uploads/758c71e3c160e0f9fc50a507323daa7f/device-2016-02-10-154634.png)


See merge request !100
2016-02-16 10:36:24 +00:00
akwizgran
0a7823e7f5 Changed background colour to FAFAFA.
Psycho killer, qu'est-ce que c'est?
2016-02-16 10:31:57 +00:00
akwizgran
b50dce1c8d Removed an unused method. 2016-02-16 10:25:32 +00:00
akwizgran
9f8baab60f Code cleanup. 2016-02-11 16:26:23 +00:00
akwizgran
074892b677 StorageStatus is no longer needed. 2016-02-11 16:26:23 +00:00
akwizgran
6505db58e6 Contact and identity managers don't need to be services. 2016-02-11 16:26:22 +00:00
akwizgran
146dac056d Broadcast events after committing transactions. 2016-02-11 16:26:22 +00:00
akwizgran
de8cc50fb4 Moved transactions out of database component. 2016-02-11 16:26:19 +00:00
akwizgran
ef2b2b9710 Removed unneeded visibility methods. 2016-02-11 16:21:53 +00:00
akwizgran
3fa1bbe33e Expose transactions through DatabaseComponent interface. 2016-02-11 16:21:53 +00:00
akwizgran
2460e1feb0 Moved author classes to identity package. 2016-02-11 16:21:52 +00:00
akwizgran
675ce4bfef Removed direct calls to DB's contact/identity methods. 2016-02-11 16:21:52 +00:00
akwizgran
623707af0f Removed database locking. 2016-02-11 16:21:52 +00:00
akwizgran
0c392e8b78 Replaced PacketWriter methods with a constant. 2016-02-11 16:21:26 +00:00
akwizgran
747d9678fe Removed unused PrivateConversation class. 2016-02-11 15:05:14 +00:00
akwizgran
29b67d2e03 Merge branch 'forum-sharing-hooks' into 'master'
Use message validation hook in forum sharing client

This patch moves the forum sharing client's update handling from an event handler to a hook to ensure the update is handled even if it arrives just before shutdown.

See merge request !99
2016-02-11 12:44:23 +00:00
Torsten Grote
00beb654af Merge branch '238-delete-messages' into 'master'
Allow messages to be deleted.

Fixes #238.

See merge request !98
2016-02-10 17:59:45 +00:00
akwizgran
3f356b999a Increase contrast between identicon and background. 2016-02-10 15:48:35 +00:00
akwizgran
bb11ebd5bd Use message validation hook in forum sharing client. 2016-02-10 14:47:25 +00:00
akwizgran
43558ca089 Merge branch 'remove-subscription-updates' into 'master'
Move subscription updates to the client layer

This is part of #112.

I created a separate client for sharing lists of available forums, as that turned out to be cleaner than using the forum client to manage two kinds of group. The same will presumably be true for the blog and group messaging clients when we come to implement them.

The UX for sharing forums is due to change - instead of sharing a list of available forums with no explanation, we'll explicitly invite contacts to join forums. When that happens, the ForumSharingManager will change but the ForumManager should remain pretty much the same.

When hooks for message status changes have been implemented, the ForumSharingManager will use those instead of listening for MessageValidatedEvents.

When client layer transactions have been implemented, the ForumManager, ForumSharingManager and TransportPropertyManager will use them instead of locks to ensure atomicity and isolation.

See merge request !94
2016-02-10 14:02:15 +00:00
akwizgran
a91d500263 Added method for deleting metadata. 2016-02-10 14:01:55 +00:00
akwizgran
00275e260f Allow messages to be deleted. 2016-02-10 14:01:55 +00:00
akwizgran
525c323c1c Fixed race between loadHeaders() and loadAvailable(). 2016-02-10 10:47:30 +00:00
akwizgran
6e1ec41d21 Handle events that affect list of available forums. 2016-02-10 10:47:30 +00:00
akwizgran
18db17bf5b Moved subscription updates to the client layer. 2016-02-10 10:47:30 +00:00
akwizgran
54272c8836 MessageFactory never throws IOException. 2016-02-10 10:47:29 +00:00
akwizgran
fd99dd7573 Updated a unit test for storing settings. 2016-02-10 10:47:29 +00:00
akwizgran
225d0ebeef DB interface cleanup, removed unnecessary exceptions. 2016-02-10 10:47:29 +00:00
akwizgran
3837efca6b Updated group-related events and exceptions. 2016-02-10 10:47:26 +00:00
akwizgran
9d537dce00 Removed contact subscriptions from database. 2016-02-10 10:46:41 +00:00
akwizgran
9fdc510843 Removed SubscriptionUpdate and SubscriptionAck. 2016-02-10 10:46:41 +00:00
akwizgran
e85b2161e4 Merge branch '241-notification-privacy' into 'master'
Set category and visibility of notifications. #241

Turns out we can't fully control the visibility of notifications on the lock screen - we can mark them as sensitive, and then a couple of global options determine whether they're visible.

See merge request !96
2016-02-10 10:34:37 +00:00
akwizgran
299a541dee Set category and visibility of notifications. #241 2016-02-10 10:31:31 +00:00
Torsten Grote
d0ab16de2d Merge branch 'merge-settings' into 'master'
Fix a couple of bugs in settings

1. SettingsFragment wasn't receiving events because it extended BaseFragment rather than BaseEventFragment
2. Removed broken logic for deciding whether to broadcast a SettingsUpdatedEvent
3. Added the namespace to SettingsUpdatedEvent so listeners can decide whether to react

See merge request !97
2016-02-09 16:55:42 +00:00
Torsten Grote
5dab0c0dcb Merge branch '242-anonymous-forum-crash' into 'master'
Fix crashes, rotation issues with forum posts. #242, #243



See merge request !93
2016-02-09 16:51:45 +00:00