diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-06-25 23:58:36 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-06-25 23:58:36 +0300 |
commit | 3a43c6223f7f4f21dda0a484ef3ec858102c836c (patch) | |
tree | 337ce8e52c02facb41b49a0a06322240119ebfda /xmpp/handlers.go | |
parent | 493c49cde5b5d51f3dd9bc6b1a925b0fd2a1c52f (diff) |
Fix calculating avatar Base64
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r-- | xmpp/handlers.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go index ee1db21..870a292 100644 --- a/xmpp/handlers.go +++ b/xmpp/handlers.go @@ -258,11 +258,12 @@ func handleGetVcardTempIq(s xmpp.Sender, iq *stanza.IQ) { buf := new(bytes.Buffer) binval := base64.NewEncoder(base64.StdEncoding, buf) _, err = io.Copy(binval, file) + binval.Close() if err == nil { vcard.Photo.Type.Text = "image/jpeg" vcard.Photo.Binval.Text = buf.String() } else { - log.Errorf("Error calculating hash: %v", path) + log.Errorf("Error calculating base64: %v", path) } } else if path != "" { log.Errorf("Photo does not exist: %v", path) |