Watch
1
0
Fork
You've already forked mautrix-signal
0
mirror of https://github.com/mautrix/signal.git synced 2026-11-09 07:39:20 -05:00

Compare commits

..
Author SHA1 Message Date
Gerardo Rodriguez
0664587a4b ci: cache pre-commit hooks per Go version 2026-11-05 03:04:54 +00:00
3 changed files with 10 additions and 14 deletions

View file

@ -30,11 +30,16 @@ jobs:
run: | run: |
go install golang.org/x/tools/cmd/goimports@latest go install golang.org/x/tools/cmd/goimports@latest
go install honnef.co/go/tools/cmd/staticcheck@latest go install honnef.co/go/tools/cmd/staticcheck@latest
go install github.com/beeper/pre-commit-go/bridgelint@latest
export PATH="$HOME/go/bin:$PATH" export PATH="$HOME/go/bin:$PATH"
- name: Cache pre-commit
uses: actions/cache@v6
with:
path: ~/.cache/pre-commit
key: pre-commit-go${{ matrix.go-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit - name: Run pre-commit
uses: pre-commit/action@v3.0.1 run: pipx run pre-commit run --all-files --show-diff-on-failure --color=always
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -27,5 +27,4 @@ repos:
- id: zerolog-ban-msgf - id: zerolog-ban-msgf
- id: zerolog-use-stringer - id: zerolog-use-stringer
- id: bridgelint - id: bridgelint
language: system
verbose: true verbose: true

View file

@ -445,15 +445,11 @@ func (s *SignalClient) GetContactList(ctx context.Context) ([]*bridgev2.ResolveI
} }
resp := make([]*bridgev2.ResolveIdentifierResponse, len(recipients)) resp := make([]*bridgev2.ResolveIdentifierResponse, len(recipients))
for i, recipient := range recipients { for i, recipient := range recipients {
if err = ctx.Err(); err != nil { recipientResp := &bridgev2.ResolveIdentifierResponse{
return nil, err Chat: s.makeCreateDMResponse(ctx, recipient, nil),
} }
recipientResp := &bridgev2.ResolveIdentifierResponse{}
var username string var username string
if recipient.ACI != uuid.Nil { if recipient.ACI != uuid.Nil {
recipientResp.Chat = &bridgev2.CreateChatResponse{
PortalKey: s.makeDMPortalKey(libsignalgo.NewACIServiceID(recipient.ACI)),
}
recipientResp.UserID = signalid.MakeUserID(recipient.ACI) recipientResp.UserID = signalid.MakeUserID(recipient.ACI)
ghost, err := s.Main.Bridge.GetGhostByID(ctx, recipientResp.UserID) ghost, err := s.Main.Bridge.GetGhostByID(ctx, recipientResp.UserID)
if err != nil { if err != nil {
@ -462,11 +458,7 @@ func (s *SignalClient) GetContactList(ctx context.Context) ([]*bridgev2.ResolveI
recipientResp.Ghost = ghost recipientResp.Ghost = ghost
username = ghost.Metadata.(*signalid.GhostMetadata).Username username = ghost.Metadata.(*signalid.GhostMetadata).Username
} else { } else {
pniServiceID := libsignalgo.NewPNIServiceID(recipient.PNI) recipientResp.UserID = signalid.MakeUserIDFromServiceID(libsignalgo.NewPNIServiceID(recipient.PNI))
recipientResp.Chat = &bridgev2.CreateChatResponse{
PortalKey: s.makeDMPortalKey(pniServiceID),
}
recipientResp.UserID = signalid.MakeUserIDFromServiceID(pniServiceID)
} }
recipientResp.UserInfo, err = s.contactToUserInfo(ctx, recipient, username, false) recipientResp.UserInfo, err = s.contactToUserInfo(ctx, recipient, username, false)
if err != nil { if err != nil {