added an invitation message
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
ycc
2024-01-01 13:50:00 +01:00
parent 6788487368
commit 25cf1808e3
4 changed files with 95 additions and 82 deletions

View File

@ -43,7 +43,7 @@ func CreateIdentity(nickname string) *Identity {
}
// Creates an invitation for a peer, returns the peer containing
func (id *Identity) InvitePeer(MyName string, ContactName string, MessageServerIdxs []int) (*Peer, error) {
func (id *Identity) InvitePeer(MyName string, ContactName string, MessageServerIdxs []int, InvitationMessage string) (*Peer, error) {
var peer Peer
peer.MyIdentity = meowlib.NewKeyPair()
peer.MyEncryptionKp = meowlib.NewKeyPair()
@ -67,6 +67,7 @@ func (id *Identity) InvitePeer(MyName string, ContactName string, MessageServerI
peer.MyContact.EncryptionPublicKey = peer.MyEncryptionKp.Public
peer.MyContact.LookupPublicKey = peer.MyLookupKp.Public
peer.MyContact.InvitationId = peer.InvitationId
peer.MyContact.InvitationMessage = InvitationMessage
id.Peers = append(id.Peers, peer)
return &peer, nil