X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/723f6e18adc6482ed913e1618c8a76e981720c2b..0da50dc187c8b4aa23ac1ddd0418c0da779389d9:/whatsapp.go diff --git a/whatsapp.go b/whatsapp.go index 851cfd1..f225756 100644 --- a/whatsapp.go +++ b/whatsapp.go @@ -95,6 +95,7 @@ type WhatsAppClient interface { PairPhone(ctx context.Context, phone string, showPushNotification bool, clientType whatsmeow.PairClientType, clientDisplayName string) (string, error) Logout(ctx context.Context) error GetJoinedGroups(ctx context.Context) ([]*types.GroupInfo, error) + Download(ctx context.Context, message whatsmeow.DownloadableMessage) ([]byte, error) GenerateMessageID() types.MessageID SendMessage(ctx context.Context, to types.JID, message *waE2E.Message, extra ...whatsmeow.SendRequestExtra) (whatsmeow.SendResponse, error) } @@ -123,7 +124,7 @@ func openWhatsApp(ctx context.Context, dir string, clock func() time.Time, logge return nil, err } - w.inbox = newWhatsAppInbox(w.state, clock, w.groups) + w.inbox = newWhatsAppInbox(w.state, clock, w.groups, &ImageStore{dir: filepath.Join(dir, imageDirName)}, logger) info, err := os.Stat(w.sessionPath()) if errors.Is(err, os.ErrNotExist) { @@ -168,9 +169,9 @@ func openWhatsApp(ctx context.Context, dir string, clock func() time.Time, logge // creation, close, removal, and snapshots. It is held before mutex, and stays // held when removal releases mutex for client callbacks. // -// The inbox puts the text messages into batches and logs them, and groups -// holds the names of the groups. Both get a WhatsAppLink from link for each -// call, so they use the current device and client. +// The inbox puts messages into batches and logs them, and groups holds the +// names of the groups. Both get a WhatsAppLink from link for each call, so they +// use the current device and client. // // The library logs nothing, because its log lines hold the ID of the own // account, which is the phone number of the user. The own number and the own