mirror of
https://github.com/mautrix/whatsapp.git
synced 2025-03-14 14:15:38 +00:00
connector/startchat: check for logged in before listing contacts
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
parent
f20db56358
commit
6af0c009ab
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue