|
|
|
@ -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)
|
|
|
|
|