Skip to content

Commit

Permalink
connector/startchat: check for logged in before listing contacts
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Jan 13, 2025
1 parent f20db56 commit 6af0c00
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/connector/startchat.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ func matchesQuery(str string, query string) bool {
}

func (wa *WhatsAppClient) getContactList(ctx context.Context, filter string) ([]*bridgev2.ResolveIdentifierResponse, error) {
if !wa.IsLoggedIn() {
return nil, mautrix.MForbidden.WithMessage("You must be logged in to list contacts")
}
contacts, err := wa.Client.Store.Contacts.GetAllContacts()
if err != nil {
return nil, err
Expand Down

0 comments on commit 6af0c00

Please sign in to comment.