Add invitation message to CheckInvitation function
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc 2024-02-20 22:44:19 +01:00
parent 9dcb579d93
commit c4b61e16c5

View File

@ -77,13 +77,13 @@ func (id *Identity) InvitePeer(MyName string, ContactName string, MessageServerU
} }
// Checks if the received contact card is an answer to an invitation, returns true if it is, and the proposed and received nicknames // Checks if the received contact card is an answer to an invitation, returns true if it is, and the proposed and received nicknames
func (id *Identity) CheckInvitation(ReceivedContact *meowlib.ContactCard) (isAnswer bool, proposedNick string, receivedNick string) { func (id *Identity) CheckInvitation(ReceivedContact *meowlib.ContactCard) (isAnswer bool, proposedNick string, receivedNick string, invitationMessage string) {
for _, p := range id.Peers { for _, p := range id.Peers {
if p.InvitationId == ReceivedContact.InvitationId { if p.InvitationId == ReceivedContact.InvitationId {
return true, p.Name, ReceivedContact.Name return true, p.Name, ReceivedContact.Name, ReceivedContact.InvitationMessage
} }
} }
return false, "", ReceivedContact.Name return false, "", ReceivedContact.Name, ReceivedContact.InvitationMessage
} }
// Answers an invitation, returns the newly created peer including infos to provide a ContactCard // Answers an invitation, returns the newly created peer including infos to provide a ContactCard