aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-06-01 23:26:15 +0200
committerAlex Auvolat <alex@adnab.me>2021-06-01 23:26:15 +0200
commitadf163bad564b16c7caefbdfb9ccfb9abac9fa97 (patch)
tree8fc0508d90c7469685bd049372de2916a4165e7f
parent78b40374105633fe908a8bf2f556a92a370fbfa1 (diff)
downloadeasybridge-adf163bad564b16c7caefbdfb9ccfb9abac9fa97.tar.gz
easybridge-adf163bad564b16c7caefbdfb9ccfb9abac9fa97.zip
Add type: m.login.application_service to register call
-rw-r--r--.drone.yml7
-rw-r--r--mxlib/api.go7
-rw-r--r--mxlib/client.go3
3 files changed, 16 insertions, 1 deletions
diff --git a/.drone.yml b/.drone.yml
new file mode 100644
index 0000000..853c5f2
--- /dev/null
+++ b/.drone.yml
@@ -0,0 +1,7 @@
+pipeline:
+ build:
+ image: golang:stretch
+ commands:
+ - go get -d -v
+ - go build -v
+
diff --git a/mxlib/api.go b/mxlib/api.go
index 6d35108..9cd02d5 100644
--- a/mxlib/api.go
+++ b/mxlib/api.go
@@ -40,7 +40,12 @@ type LoginResponse struct {
}
type RegisterRequest struct {
- Username string `json:"username"`
+ Auth RegisterRequestAuth `json:"auth"`
+ Username string `json:"username"`
+}
+
+type RegisterRequestAuth struct {
+ Type string `json:"type"`
}
type RegisterResponse struct {
diff --git a/mxlib/client.go b/mxlib/client.go
index c111360..689d3a0 100644
--- a/mxlib/client.go
+++ b/mxlib/client.go
@@ -144,6 +144,9 @@ func (mx *Client) PasswordLogin(username string, password string, device_id stri
func (mx *Client) RegisterUser(username string) error {
req := RegisterRequest{
+ Auth: RegisterRequestAuth{
+ Type: "m.login.application_service",
+ },
Username: username,
}
var rep RegisterResponse