diff options
author | Tilo Spannagel <development@tilosp.de> | 2020-08-30 15:19:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-30 15:19:51 +0200 |
commit | ad90cf09fe26693d1ba325cd2d578fcf0e39a90d (patch) | |
tree | b68594640fd1cca8f7974723198dcf4bbc2ca18c /vendor/gomod.garykim.dev/nc-talk/room/room.go | |
parent | f9928c9e259fefee5bd049dbc8d8e5d98107f136 (diff) | |
download | matterbridge-msglm-ad90cf09fe26693d1ba325cd2d578fcf0e39a90d.tar.gz matterbridge-msglm-ad90cf09fe26693d1ba325cd2d578fcf0e39a90d.tar.bz2 matterbridge-msglm-ad90cf09fe26693d1ba325cd2d578fcf0e39a90d.zip |
Update nc-talk to version 0.1.2 (#1220)
Signed-off-by: Tilo Spannagel <development@tilosp.de>
Diffstat (limited to 'vendor/gomod.garykim.dev/nc-talk/room/room.go')
-rw-r--r-- | vendor/gomod.garykim.dev/nc-talk/room/room.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/vendor/gomod.garykim.dev/nc-talk/room/room.go b/vendor/gomod.garykim.dev/nc-talk/room/room.go index 5452993d..3527bb7a 100644 --- a/vendor/gomod.garykim.dev/nc-talk/room/room.go +++ b/vendor/gomod.garykim.dev/nc-talk/room/room.go @@ -18,6 +18,7 @@ import ( "context" "errors" "io/ioutil" + "strconv" "time" "github.com/monaco-io/request" @@ -98,16 +99,16 @@ func (t *TalkRoom) ReceiveMessages(ctx context.Context) (chan ocs.TalkRoomMessag "includeLastKnown": "0", } lastKnown := "" - client := t.User.RequestClient(request.Client{ - URL: url, - Params: requestParam, - Timeout: time.Second * 60, - }) - res, err := client.Resp() + res, err := t.User.GetRooms() if err != nil { return nil, err } - lastKnown = res.Header.Get("X-Chat-Last-Given") + for _, r := range *res { + if r.Token == t.Token { + lastKnown = strconv.Itoa(r.LastReadMessage) + break + } + } go func() { for { if ctx.Err() != nil { |