Commit Graph

18 Commits

Author SHA1 Message Date
John Brooks d8a14fb4c5 Remove the concept of numeric contact IDs
In ricochet-qt, contacts were stored with a sequential numeric ID, and
that was used in various places to refer to the contact uniquely. The
habit carried over here in an attempt to keep configuration
compatibility.

These IDs are error prone (particularly over RPC) and unnecessary. This
removes the entire concept and uses addresses to index and refer
uniquely to contacts everywhere.
2017-09-24 17:00:44 -06:00
John Brooks 32230b77c1 core: Reuse protobuf structures for configuration
The existing configuration was partially compatible with Ricochet's,
but not enough to actually be useful. It also required a bunch of
boilerplate code to copy data between configuration data structures,
internal data structures, and RPC data structures.

Protobuf conveniently supports encoding messages to JSON, and we already
need to store most data (e.g. contacts) in protobuf structures. This
commit changes the configuration to be a protobuf JSON serialization of
the Config message, which can directly reuse RPC messages like Contact.

Additionally, the RWMutex-based configuration type was a deadlock
waiting to happen. There is now a read-only clone of the configuration
available atomically at any time. Writers need an exclusive lock on the
ConfigFile object, which commits its changes to disk and readers on
unlock.
2017-09-24 16:59:44 -06:00
John Brooks b5301c2782 Implement inbound contact request protocol
This implements a handler for inbound contact request connections,
taking advantage of the synchronous Process API.

This is largely untested code at the moment.
2017-09-23 19:19:24 -06:00
John Brooks 0c187e72a0 Port core to the new go-ricochet API
This includes connection management and enough to compile, but doesn't
reimplement most of the protocol messages and functionality yet. There
are problems noted throughout the code, also.
2017-09-23 19:17:43 -06:00
John Brooks 23e22f0260 core: Minor fixes for inbound contact requests 2017-08-11 18:04:28 -06:00
John Brooks dcda924d56 core: Implement inbound contact requests
This does not yet include persistence of inbound requests in the config,
and it's mostly untested, but it's more or less complete.
2017-08-10 11:26:09 -06:00
John Brooks 7dbac1cdf7 core: Add functions to sanitize nicknames and messages 2016-12-27 17:42:16 -07:00
John Brooks 9c0110dca2 core: Use consistent functions to validate and convert address formats 2016-11-05 21:27:13 -06:00
John Brooks 91dbe5a261 core: Remove outdated todo comments 2016-11-05 20:44:20 -06:00
John Brooks 1c0c3242eb core: Improve start/stop of contact connections 2016-10-28 16:17:19 -06:00
John Brooks 8baf1034f6 core: RPC and config for outbound contact requests 2016-10-27 14:18:00 -06:00
John Brooks d37d40def4 Change imports after moving repository 2016-10-16 22:26:35 -06:00
John Brooks 7c20d535c7 core: Fix build 2016-10-16 15:50:59 -06:00
John Brooks 289d0f4dc2 core: Send contact update events on status change 2016-09-19 19:53:21 -06:00
John Brooks 83d4d8841d core: Change the 'Ricochet' API again 2016-09-10 23:00:26 -06:00
John Brooks 20700414fc core: Implement contact list monitor and contact removal 2016-09-02 11:51:24 -05:00
John Brooks 2c4a1c8b37 core: Load contacts from config 2016-08-29 20:46:41 -06:00
John Brooks 0508f0b5e3 Skeleton of core API 2016-06-30 21:18:55 -06:00