aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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