update deps
This commit is contained in:
1
vendor/gitlab.com/etke.cc/linkpearl/README.md
generated
vendored
1
vendor/gitlab.com/etke.cc/linkpearl/README.md
generated
vendored
@@ -32,4 +32,5 @@ go lp.Start()
|
||||
* Zero configuration session restores
|
||||
* Zero configuration room and user account data encryption with AES GCM (both keys and values)
|
||||
* Zero configuration room and user account data caching
|
||||
* Threads support
|
||||
* All wrapped components exported
|
||||
|
||||
30
vendor/gitlab.com/etke.cc/linkpearl/events.go
generated
vendored
30
vendor/gitlab.com/etke.cc/linkpearl/events.go
generated
vendored
@@ -32,7 +32,35 @@ func (l *Linkpearl) Threads(roomID id.RoomID, fromToken ...string) (*RespThreads
|
||||
return resp, UnwrapError(err)
|
||||
}
|
||||
|
||||
// FindEventBy tries to find event by field and value
|
||||
// FindThreadBy tries to find thread message event by field and value
|
||||
func (l *Linkpearl) FindThreadBy(roomID id.RoomID, field, value string, fromToken ...string) *event.Event {
|
||||
var from string
|
||||
if len(fromToken) > 0 {
|
||||
from = fromToken[0]
|
||||
}
|
||||
|
||||
resp, err := l.Threads(roomID, from)
|
||||
err = UnwrapError(err)
|
||||
if err != nil {
|
||||
l.log.Warn().Err(err).Str("roomID", roomID.String()).Msg("cannot get room threads")
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, msg := range resp.Chunk {
|
||||
evt, contains := l.eventContains(msg, field, value)
|
||||
if contains {
|
||||
return evt
|
||||
}
|
||||
}
|
||||
|
||||
if resp.NextBatch == "" { // nothing more
|
||||
return nil
|
||||
}
|
||||
|
||||
return l.FindThreadBy(roomID, field, value, resp.NextBatch)
|
||||
}
|
||||
|
||||
// FindEventBy tries to find message event by field and value
|
||||
func (l *Linkpearl) FindEventBy(roomID id.RoomID, field, value string, fromToken ...string) *event.Event {
|
||||
var from string
|
||||
if len(fromToken) > 0 {
|
||||
|
||||
10
vendor/gitlab.com/etke.cc/linkpearl/justfile
generated
vendored
10
vendor/gitlab.com/etke.cc/linkpearl/justfile
generated
vendored
@@ -3,9 +3,8 @@ default:
|
||||
@just --list --justfile {{ justfile() }}
|
||||
|
||||
# update go deps
|
||||
update:
|
||||
go get .
|
||||
go get maunium.net/go/mautrix@latest
|
||||
update *flags:
|
||||
go get {{flags}} .
|
||||
go mod tidy
|
||||
|
||||
# run linter
|
||||
@@ -16,11 +15,8 @@ lint:
|
||||
lintfix:
|
||||
golangci-lint run --fix ./...
|
||||
|
||||
vuln:
|
||||
govulncheck ./...
|
||||
|
||||
# run unit tests
|
||||
test:
|
||||
@go test -coverprofile=cover.out ./...
|
||||
@go test -cover -coverprofile=cover.out -coverpkg=./... -covermode=set ./...
|
||||
@go tool cover -func=cover.out
|
||||
-@rm -f cover.out
|
||||
|
||||
Reference in New Issue
Block a user