[headless] expose contact connected state to REST API

This commit is contained in:
Torsten Grote
2020-07-06 08:16:53 -03:00
parent 9d96ce6db0
commit 3f0d9233d9
5 changed files with 110 additions and 10 deletions

View File

@@ -68,7 +68,8 @@ Returns a JSON array of contacts:
"alias" : "A local nickname",
"handshakePublicKey": "XnYRd7a7E4CTqgAvh4hCxh/YZ0EPscxknB9ZcEOpSzY=",
"verified": true,
"lastChatActivity": 1557838312175
"lastChatActivity": 1557838312175,
"connected": false
}
```
@@ -392,3 +393,19 @@ will no longer work on making this `pendingContact` become `contact`.
"type": "event"
}
```
### A contact connected or disconnected
When Briar establishes a connection to a contact (the contact comes online),
it sends a `ContactConnectedEvent`.
When the last connection is lost (the contact goes offline), it sends a `ContactDisconnectedEvent`.
```json
{
"data": {
"contactId": 1
},
"name": "ContactConnectedEvent",
"type": "event"
}
```