Browse Source

device: save & load device pair status and public key to/from cache

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
bboozzoo/pairing-fixes
Maciek Borzecki 8 years ago
parent
commit
ed4c4b04e2
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/mconnect/device.vala

+ 4
- 0
src/mconnect/device.vala View File

@ -107,6 +107,8 @@ class Device : Object {
var last_ip_str = cache.get_string(name, "lastIPAddress");
debug("last known address: %s:%u", last_ip_str, dev.tcp_port);
dev.allowed = cache.get_boolean(name, "allowed");
dev.is_paired = cache.get_boolean(name, "paired");
dev.public_key = cache.get_string(name, "public_key");
var host = new InetAddress.from_string(last_ip_str);
if (host == null) {
@ -153,6 +155,8 @@ class Device : Object {
cache.set_integer(name, "tcpPort", (int) this.tcp_port);
cache.set_string(name, "lastIPAddress", this.host.to_string());
cache.set_boolean(name, "allowed", this.allowed);
cache.set_boolean(name, "paired", this.is_paired);
cache.set_string(name, "public_key", this.public_key);
}
private async void greet() {


Loading…
Cancel
Save