readmessage cleanup
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc
2024-03-29 19:31:48 +01:00
parent a65d4f1a69
commit 657fdbbf48
4 changed files with 35 additions and 35 deletions

View File

@ -1,9 +1,7 @@
package helpers
import (
"encoding/json"
"errors"
"fmt"
"os"
"path/filepath"
"strconv"
@ -144,9 +142,9 @@ func ReadMessage(messageFilename string, detachFilesStoragePath string) ([]strin
return nil, nil, "ReadMessage: ProcessInboundUserMessage", err
}
fmt.Println("From:", usermsg.From)
jsonUserMessage, _ := json.Marshal(usermsg)
fmt.Println(string(jsonUserMessage))
//fmt.Println("From:", usermsg.From)
//jsonUserMessage, _ := json.Marshal(usermsg)
//fmt.Println(string(jsonUserMessage))
// detach files
if usermsg.Files != nil {
@ -159,7 +157,8 @@ func ReadMessage(messageFilename string, detachFilesStoragePath string) ([]strin
//? result["invitation finalized"] = peer.Name
}
// user message
messagesOverview = append(messagesOverview, usermsg.From+" > "+string(usermsg.Data))
peer = client.GetConfig().GetIdentity().Peers.GetFromPublicKey(usermsg.From)
messagesOverview = append(messagesOverview, peer.Name+" > "+string(usermsg.Data))
// add message to storage
err = peer.StoreMessage(usermsg, filenames)
if err != nil {