Remove message files after ReadMessage processing
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
b556cd0361
commit
13cfda928d
@ -173,50 +173,14 @@ func ReadMessage(messageFilename string, detachFilesStoragePath string) ([]strin
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, "ReadMessage: StoreMessage", err
|
return nil, nil, "ReadMessage: StoreMessage", err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
err = os.Remove(messageFilename)
|
||||||
|
|
||||||
// fmt.Println("have read fromServerMessage, will unmarshal packed")
|
|
||||||
// // protobuf unmarshal message //! WRONG !!!!
|
|
||||||
// var packedMessage meowlib.PackedUserMessage
|
|
||||||
// err = proto.Unmarshal(userMessage, &packedMessage)
|
|
||||||
// if err != nil {
|
|
||||||
// return C.CString(errorToJson(err, "ReadMessage: Unmarshal PackedUserMessage"))
|
|
||||||
// }
|
|
||||||
// fmt.Println("Destination:", packedMessage.Destination)
|
|
||||||
// fmt.Println("Payload lengh:", len(packedMessage.Pay ""load))
|
|
||||||
// server invitation finalize or more ?
|
|
||||||
/*
|
|
||||||
if fromServerMessage.Invitation != nil {
|
|
||||||
fmt.Println("Invitation from:", fromServerMessage.Invitation.From)
|
|
||||||
// find the peer with that lookup key
|
|
||||||
// todo get from invitation id
|
|
||||||
//! FOLOWING statement is WRONG !
|
|
||||||
peer := client.GetConfig().GetIdentity().Peers.GetFromPublicKey(fromServerMessage.Invitation.From)
|
|
||||||
if peer == nil {
|
|
||||||
return nil, nil, "ReadMessage: GetFromPublicKey", errors.New("no visible peer for that message")
|
|
||||||
}
|
|
||||||
peer.ContactPublicKey = fromServerMessage.Invitation.From
|
|
||||||
str, _ := json.Marshal(peer)
|
|
||||||
fmt.Println("Peer:", string(str))
|
|
||||||
// invitation message
|
|
||||||
var receivedContactCard meowlib.ContactCard
|
|
||||||
err := proto.Unmarshal(fromServerMessage.Invitation.Payload, &receivedContactCard)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "ReadMessage: Unmarshal ContactCard", err
|
return nil, nil, "ReadMessage: Remove", err
|
||||||
}
|
}
|
||||||
err = client.GetConfig().GetIdentity().FinalizeInvitation(&receivedContactCard)
|
|
||||||
if err != nil {
|
|
||||||
return "", "ReadMessage: FinalizeInvitation", err
|
|
||||||
}
|
|
||||||
result["invitation finalized"] = peer.Name
|
|
||||||
|
|
||||||
|
// list of messages & detached files
|
||||||
}*/
|
|
||||||
|
|
||||||
// message
|
|
||||||
// including list of detached files
|
|
||||||
return messagesOverview, filenames, "", nil
|
return messagesOverview, filenames, "", nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user