update deps

This commit is contained in:
Aine
2023-12-19 12:48:50 +02:00
parent fe17195bc1
commit c19c87393c
441 changed files with 11883 additions and 7230 deletions

View File

@@ -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

View File

@@ -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 {

View File

@@ -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