diff options
author | Daniil Suvorov <severecloud@gmail.com> | 2022-04-23 00:37:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 23:37:09 +0200 |
commit | ee932a9f8e37716e8e401389a083c2aeecbf4efa (patch) | |
tree | e7228c120c38b73867ba0b57a3b5faa3c01b7335 /bridge/vk | |
parent | ce18c948e620b658c19200d6875202877b2691a4 (diff) | |
download | matterbridge-msglm-ee932a9f8e37716e8e401389a083c2aeecbf4efa.tar.gz matterbridge-msglm-ee932a9f8e37716e8e401389a083c2aeecbf4efa.tar.bz2 matterbridge-msglm-ee932a9f8e37716e8e401389a083c2aeecbf4efa.zip |
Fix UploadMessagesPhoto for vk community chat (vk) (#1812)
Diffstat (limited to 'bridge/vk')
-rw-r--r-- | bridge/vk/vk.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bridge/vk/vk.go b/bridge/vk/vk.go index 3e73b9a2..7faa5b40 100644 --- a/bridge/vk/vk.go +++ b/bridge/vk/vk.go @@ -64,7 +64,7 @@ func (b *Bvk) Connect() error { go func() { err := b.lp.Run() if err != nil { - b.Log.Fatal("Enable longpoll in group management") + b.Log.WithError(err).Fatal("Enable longpoll in group management") } }() @@ -223,7 +223,7 @@ func (b *Bvk) uploadFiles(extra map[string][]interface{}, peerID int) (string, s } a, err := b.uploadFile(fi, peerID) if err != nil { - b.Log.Error("File upload error ", fi.Name) + b.Log.WithError(err).Error("File upload error ", fi.Name) } attachments = append(attachments, a) @@ -237,7 +237,8 @@ func (b *Bvk) uploadFile(file config.FileInfo, peerID int) (string, error) { photoRE := regexp.MustCompile(".(jpg|jpe|png)$") if photoRE.MatchString(file.Name) { - p, err := b.c.UploadMessagesPhoto(peerID, r) + // BUG(VK): for community chat peerID=0 + p, err := b.c.UploadMessagesPhoto(0, r) if err != nil { return "", err } |