From 831dfd27a687ff025edc0dc7d0a1ed9a01fba48d Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 2 Dec 2016 17:02:25 +0000 Subject: [PATCH] Add missing User-Interactive fields. Only add access_token if one was given. --- client.go | 4 +++- responses.go | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 11d797c..af0f605 100644 --- a/client.go +++ b/client.go @@ -75,7 +75,9 @@ func (cli *Client) BuildBaseURL(urlPath ...string) string { parts = append(parts, urlPath...) hsURL.Path = path.Join(parts...) query := hsURL.Query() - query.Set("access_token", cli.AccessToken) + if cli.AccessToken != "" { + query.Set("access_token", cli.AccessToken) + } hsURL.RawQuery = query.Encode() return hsURL.String() } diff --git a/responses.go b/responses.go index a4564ad..a387630 100644 --- a/responses.go +++ b/responses.go @@ -40,8 +40,11 @@ type RespUserInteractive struct { Flows []struct { Stages []string `json:"stages"` } `json:"flows"` - Params map[string]interface{} `json:"params"` - Session string `json:"string"` + Params map[string]interface{} `json:"params"` + Session string `json:"string"` + Completed []string `json:"completed"` + ErrCode string `json:"errcode"` + Error string `json:"error"` } // RespRegister is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-register