Update mautrix-appservice

This commit is contained in:
Tulir Asokan 2018-08-27 00:48:32 +03:00
parent 6db0dc23ab
commit 87b135e2a6
3 changed files with 9 additions and 4 deletions

4
Gopkg.lock generated
View File

@ -123,7 +123,7 @@
".", ".",
"format" "format"
] ]
revision = "692bae934fcd3b7f4379e89d7271220f1d81f318" revision = "ead1f970c8f56d1854cb9eb4a54c03aa6dafd753"
[[projects]] [[projects]]
branch = "master" branch = "master"
@ -141,7 +141,7 @@
branch = "master" branch = "master"
name = "maunium.net/go/mautrix-appservice" name = "maunium.net/go/mautrix-appservice"
packages = ["."] packages = ["."]
revision = "62ccd06944c74b6e526b493ef66fc736d23b1cf2" revision = "269f2ab602126a2de94bc86a457392426cce1ab2"
[solve-meta] [solve-meta]
analyzer-name = "dep" analyzer-name = "dep"

View File

@ -677,6 +677,7 @@ func (cli *Client) Upload(content io.Reader, contentType string, contentLength i
} }
req.Header.Set("Content-Type", contentType) req.Header.Set("Content-Type", contentType)
req.ContentLength = contentLength req.ContentLength = contentLength
cli.LogRequest(req, fmt.Sprintf("%d bytes", contentLength))
res, err := cli.Client.Do(req) res, err := cli.Client.Do(req)
if res != nil { if res != nil {
defer res.Body.Close() defer res.Body.Close()

View File

@ -113,8 +113,12 @@ func (store *BasicStateStore) GetRoomMemberships(roomID string) map[string]strin
func (store *BasicStateStore) GetMembership(roomID, userID string) string { func (store *BasicStateStore) GetMembership(roomID, userID string) string {
store.membershipsLock.RLock() store.membershipsLock.RLock()
membership, ok := store.GetRoomMemberships(roomID)[userID] defer store.membershipsLock.RUnlock()
store.membershipsLock.RUnlock() memberships, ok := store.Memberships[roomID]
if !ok {
return "leave"
}
membership, ok := memberships[userID]
if !ok { if !ok {
return "leave" return "leave"
} }