Update protocol

This commit is contained in:
Finn 2021-02-18 17:52:50 -08:00
parent daf2a8be34
commit 80a6cc017a
3 changed files with 31 additions and 16 deletions

View file

@ -2,9 +2,9 @@
"doc_version": "v1", "doc_version": "v1",
"version": { "version": {
"name": "signald", "name": "signald",
"version": "0.12.0+git2021-02-18r64bd433c.35", "version": "0.12.0+git2021-02-18r577f6d0f.36",
"branch": "main", "branch": "main",
"commit": "64bd433c25d9f66523171d53aa7a26ec921a6473" "commit": "577f6d0f076466fe6006fea2e99c53519531830b"
}, },
"info": "This document describes objects that may be used when communicating with signald.", "info": "This document describes objects that may be used when communicating with signald.",
"types": { "types": {
@ -34,7 +34,7 @@
}, },
"timestamp": { "timestamp": {
"type": "long", "type": "long",
"example": "1613632213480" "example": "1613676833495"
}, },
"timestampISO": { "timestampISO": {
"type": "String" "type": "String"
@ -44,7 +44,7 @@
}, },
"serverDeliveredTimestamp": { "serverDeliveredTimestamp": {
"type": "long", "type": "long",
"example": "161363221348080" "example": "161367683349580"
}, },
"hasLegacyMessage": { "hasLegacyMessage": {
"type": "boolean" "type": "boolean"
@ -124,7 +124,7 @@
}, },
"timestamp": { "timestamp": {
"type": "long", "type": "long",
"example": "1613632213480" "example": "1613676833495"
} }
} }
}, },
@ -165,7 +165,7 @@
}, },
"version": { "version": {
"type": "String", "type": "String",
"example": "\"0.12.0+git2021-02-18r64bd433c.35\"" "example": "\"0.12.0+git2021-02-18r577f6d0f.36\""
}, },
"branch": { "branch": {
"type": "String", "type": "String",
@ -173,7 +173,7 @@
}, },
"commit": { "commit": {
"type": "String", "type": "String",
"example": "\"64bd433c25d9f66523171d53aa7a26ec921a6473\"" "example": "\"577f6d0f076466fe6006fea2e99c53519531830b\""
} }
} }
}, },
@ -517,7 +517,7 @@
"list": true, "list": true,
"type": "Long", "type": "Long",
"doc": "List of messages to mark as read", "doc": "List of messages to mark as read",
"example": "1613632213480", "example": "1613676833495",
"required": true "required": true
} }
} }
@ -673,6 +673,16 @@
"fields": {}, "fields": {},
"doc": "Generate a linking URI. Typically this is QR encoded and scanned by the primary device. Submit the returned session_id with a finish_link request." "doc": "Generate a linking URI. Typically this is QR encoded and scanned by the primary device. Submit the returned session_id with a finish_link request."
}, },
"LinkingURI": {
"fields": {
"uri": {
"type": "String"
},
"session_id": {
"type": "String"
}
}
},
"FinishLinkRequest": { "FinishLinkRequest": {
"fields": { "fields": {
"device_name": { "device_name": {
@ -706,7 +716,7 @@
"timestamp": { "timestamp": {
"type": "long", "type": "long",
"doc": "the timestamp that the message was sent at, according to the sender's device. This is used to uniquely identify this message for things like reactions and quotes.", "doc": "the timestamp that the message was sent at, according to the sender's device. This is used to uniquely identify this message for things like reactions and quotes.",
"example": "1613632213480" "example": "1613676833495"
}, },
"attachments": { "attachments": {
"list": true, "list": true,
@ -843,7 +853,7 @@
"id": { "id": {
"type": "long", "type": "long",
"doc": "the client timestamp of the message being quoted", "doc": "the client timestamp of the message being quoted",
"example": "1613632213480" "example": "1613676833495"
}, },
"author": { "author": {
"type": "JsonAddress", "type": "JsonAddress",
@ -931,7 +941,7 @@
"targetSentTimestamp": { "targetSentTimestamp": {
"type": "long", "type": "long",
"doc": "the client timestamp of the message being reacted to", "doc": "the client timestamp of the message being reacted to",
"example": "1613632213480" "example": "1613676833495"
} }
} }
}, },
@ -1011,7 +1021,7 @@
}, },
"timestamp": { "timestamp": {
"type": "long", "type": "long",
"example": "1613632213480" "example": "1613676833495"
}, },
"expirationStartTimestamp": { "expirationStartTimestamp": {
"type": "long" "type": "long"
@ -1049,7 +1059,7 @@
}, },
"timestamp": { "timestamp": {
"type": "long", "type": "long",
"example": "1613632213480" "example": "1613676833495"
} }
} }
}, },
@ -1061,7 +1071,7 @@
}, },
"timestamp": { "timestamp": {
"type": "long", "type": "long",
"example": "1613632213480" "example": "1613676833495"
} }
} }
}, },
@ -1838,7 +1848,7 @@
}, },
"generate_linking_uri": { "generate_linking_uri": {
"request": "GenerateLinkingURIRequest", "request": "GenerateLinkingURIRequest",
"response": "String", "response": "LinkingURI",
"doc": "Generate a linking URI. Typically this is QR encoded and scanned by the primary device. Submit the returned session_id with a finish_link request." "doc": "Generate a linking URI. Typically this is QR encoded and scanned by the primary device. Submit the returned session_id with a finish_link request."
}, },
"finish_link": { "finish_link": {

View file

@ -141,7 +141,7 @@ func (r *FinishLinkRequest) Submit(conn *signald.Signald) (response Account, err
} }
// Submit: Generate a linking URI. Typically this is QR encoded and scanned by the primary device. Submit the returned session_id with a finish_link request. // Submit: Generate a linking URI. Typically this is QR encoded and scanned by the primary device. Submit the returned session_id with a finish_link request.
func (r *GenerateLinkingURIRequest) Submit(conn *signald.Signald) (response string, err error) { func (r *GenerateLinkingURIRequest) Submit(conn *signald.Signald) (response LinkingURI, err error) {
r.Version = "v1" r.Version = "v1"
r.Type = "generate_linking_uri" r.Type = "generate_linking_uri"
if r.ID == "" { if r.ID == "" {

View file

@ -292,6 +292,11 @@ type LinkedDevices struct {
Devices []*v0.DeviceInfo `json:"devices,omitempty" yaml:"devices,omitempty"` Devices []*v0.DeviceInfo `json:"devices,omitempty" yaml:"devices,omitempty"`
} }
type LinkingURI struct {
SessionId string `json:"session_id,omitempty" yaml:"session_id,omitempty"`
Uri string `json:"uri,omitempty" yaml:"uri,omitempty"`
}
type ListContactsRequest struct { type ListContactsRequest struct {
Request Request
Account string `json:"account,omitempty" yaml:"account,omitempty"` Account string `json:"account,omitempty" yaml:"account,omitempty"`