mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-08-10 18:48:10 +00:00
Update nc-talk to version 0.1.2 (#1220)
Signed-off-by: Tilo Spannagel <development@tilosp.de>
This commit is contained in:
15
vendor/gomod.garykim.dev/nc-talk/room/room.go
vendored
15
vendor/gomod.garykim.dev/nc-talk/room/room.go
vendored
@@ -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 {
|
||||
|
Reference in New Issue
Block a user