Browse Source

device: proper pair handling if device is already paired

bboozzoo/pairing-fixes
Maciek Borzecki 8 years ago
parent
commit
90e48f2333
1 changed files with 14 additions and 4 deletions
  1. +14
    -4
      src/mconnect/device.vala

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

@ -179,7 +179,7 @@ class Device : Object {
Environment.get_host_name(),
core.handlers.interfaces,
core.handlers.interfaces));
this.pair_if_needed();
this.maybe_pair();
}
/**
@ -220,9 +220,19 @@ class Device : Object {
return false;
}
public void pair_if_needed() {
if (is_paired == false && _pair_in_progress == false)
this.pair.begin();
/**
* maybe_pair:
*
* Trigger pairing or call handle_pair() if already paired.
*/
public void maybe_pair() {
if (is_paired == false) {
if (_pair_in_progress == false)
this.pair.begin();
} else {
// we are already paired
handle_pair(true, this.public_key);
}
}
/**


Loading…
Cancel
Save