gb vendor update github.com/matrix-org/gomatrix
MODIFY
vendor/manifest
vendor/manifest
{
"importpath": "github.com/matrix-org/gomatrix",
"repository": "https://github.com/matrix-org/gomatrix",
- "revision": "27ae91d1b3a3be1d83864c6c4dc38c2297f11aae",
+ "revision": "a7fc80c8060c2544fe5d4dae465b584f8e9b4e27",
"branch": "master"
},
{

MODIFY
vendor/src/github.com/matrix-org/gomatrix/client.go
vendor/src/github.com/matrix-org/gomatrix/client.go
@@ -79,7 +79,7 @@ func (cli *Client) BuildBaseURL(urlPath ...string) string {
return hsURL.String()
}
-// BuildURLWithQuery builds a URL with query paramters in addition to the Client's homeserver/prefix/access_token set already.
+// BuildURLWithQuery builds a URL with query parameters in addition to the Client's homeserver/prefix/access_token set already.
func (cli *Client) BuildURLWithQuery(urlPath []string, urlQuery map[string]string) string {
u, _ := url.Parse(cli.BuildURL(urlPath...))
q := u.Query()
@@ -387,6 +387,20 @@ func (cli *Client) JoinRoom(roomIDorAlias, serverName string, content interface{
return
}
+// GetDisplayName returns the display name of the user from the specified MXID. See https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-profile-userid-displayname
+func (cli *Client) GetDisplayName(mxid string) (resp *RespUserDisplayName, err error) {
+ urlPath := cli.BuildURL("profile", mxid, "displayname")
+ _, err = cli.MakeRequest("GET", urlPath, nil, &resp)
+ return
+}
+
+// GetOwnDisplayName returns the user's display name. See https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-profile-userid-displayname
+func (cli *Client) GetOwnDisplayName() (resp *RespUserDisplayName, err error) {
+ urlPath := cli.BuildURL("profile", cli.UserID, "displayname")
+ _, err = cli.MakeRequest("GET", urlPath, nil, &resp)
+ return
+}
+
// SetDisplayName sets the user's profile display name. See http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-profile-userid-displayname
func (cli *Client) SetDisplayName(displayName string) (err error) {
urlPath := cli.BuildURL("profile", cli.UserID, "displayname")
@@ -644,7 +658,7 @@ func (cli *Client) Messages(roomID, from, to string, dir rune, limit int) (resp
query["to"] = to
}
if limit != 0 {
- query["limit"] = string(limit)
+ query["limit"] = strconv.Itoa(limit)
}
urlPath := cli.BuildURLWithQuery([]string{"rooms", roomID, "messages"}, query)
@@ -652,6 +666,14 @@ func (cli *Client) Messages(roomID, from, to string, dir rune, limit int) (resp
return
}
+// TurnServer returns turn server details and credentials for the client to use when initiating calls.
+// See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-voip-turnserver
+func (cli *Client) TurnServer() (resp *RespTurnServer, err error) {
+ urlPath := cli.BuildURL("voip", "turnServer")
+ _, err = cli.MakeRequest("GET", urlPath, nil, &resp)
+ return
+}
+
func txnID() string {
return "go" + strconv.FormatInt(time.Now().UnixNano(), 10)
}

MODIFY
vendor/src/github.com/matrix-org/gomatrix/events.go
vendor/src/github.com/matrix-org/gomatrix/events.go
@@ -10,7 +10,7 @@ type Event struct {
StateKey *string `json:"state_key,omitempty"` // The state key for the event. Only present on State Events.
Sender string `json:"sender"` // The user ID of the sender of the event
Type string `json:"type"` // The event type
- Timestamp int `json:"origin_server_ts"` // The unix timestamp when this message was sent by the origin server
+ Timestamp int64 `json:"origin_server_ts"` // The unix timestamp when this message was sent by the origin server
ID string `json:"event_id"` // The unique ID of this event
RoomID string `json:"room_id"` // The room the event was sent to. May be nil (e.g. for presence)
Content map[string]interface{} `json:"content"` // The JSON content of the event.

MODIFY
vendor/src/github.com/matrix-org/gomatrix/hooks/pre-commit
vendor/src/github.com/matrix-org/gomatrix/hooks/pre-commit
set -eu
golint
+misspell --error .
+
+# gofmt doesn't exit with an error code if the files don't match the expected
+# format. So we have to run it and see if it outputs anything.
+if gofmt -l -s . 2>&1 | read
+then
+ echo "Error: not all code had been formatted with gofmt."
+ echo "Fixing the following files"
+ gofmt -s -w -l .
+ echo
+ echo "Please add them to the commit"
+ git status --short
+ exit 1
+fi
+
+ineffassign .
+
go fmt
go tool vet --all --shadow .
gocyclo -over 12 .

MODIFY
vendor/src/github.com/matrix-org/gomatrix/responses.go
vendor/src/github.com/matrix-org/gomatrix/responses.go
@@ -100,6 +100,11 @@ func (r RespUserInteractive) HasSingleStageFlow(stageName string) bool {
return false
}
+// RespUserDisplayName is the JSON response for https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-profile-userid-displayname
+type RespUserDisplayName struct {
+ DisplayName string `json:"displayname"`
+}
+
// RespRegister is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-register
type RespRegister struct {
AccessToken string `json:"access_token"`
@@ -162,3 +167,10 @@ type RespSync struct {
} `json:"invite"`
} `json:"rooms"`
}
+
+type RespTurnServer struct {
+ Username string `json:"username"`
+ Password string `json:"password"`
+ TTL int `json:"ttl"`
+ URIs []string `json:"uris"`
+}

gb vendor update github.com/matrix-org/gomatrix