store fix + add peer invitationPending Check
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc
2024-02-25 20:15:35 +01:00
parent c4b61e16c5
commit 4b3d7548bd
5 changed files with 21 additions and 4 deletions

View File

@ -78,11 +78,14 @@ 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
func (id *Identity) CheckInvitation(ReceivedContact *meowlib.ContactCard) (isAnswer bool, proposedNick string, receivedNick string, invitationMessage string) {
// invitation Id found, this is an answer to an invitation
for _, p := range id.Peers {
if p.InvitationId == ReceivedContact.InvitationId {
return true, p.Name, ReceivedContact.Name, ReceivedContact.InvitationMessage
}
}
// it's an invitation
return false, "", ReceivedContact.Name, ReceivedContact.InvitationMessage
}