This commit is contained in:
@ -73,12 +73,14 @@ func InvitationCreateMessage(invitationId string, invitationServerUid string, ti
|
||||
|
||||
// lookup for peer with "invitation_id"
|
||||
var myContact *meowlib.ContactCard
|
||||
for i := 0; i < len(client.GetConfig().GetIdentity().Peers); i++ {
|
||||
/* for i := 0; i < len(client.GetConfig().GetIdentity().Peers); i++ {
|
||||
if client.GetConfig().GetIdentity().Peers[i].InvitationId == invitationId {
|
||||
myContact = client.GetConfig().GetIdentity().Peers[i].GetMyContact()
|
||||
break
|
||||
}
|
||||
}
|
||||
}*/
|
||||
peer := client.GetConfig().GetIdentity().Peers.GetFromInvitationId(invitationId)
|
||||
myContact = peer.GetMyContact()
|
||||
// todo handle not found !!
|
||||
// lookup for message server with "invitation_server"
|
||||
invitationServer, err := client.GetConfig().GetIdentity().MessageServers.LoadServer(invitationServerUid) //.GetServerByIdx(int(jsoninv["invitation_server"].(float64)))
|
||||
@ -122,14 +124,20 @@ func InvitationCreateReadResponse(invitationServerUid string, invitationResponse
|
||||
// invitationId: the invitation id of the peer
|
||||
// url: the url of the invitation we got from the server
|
||||
func InvitationSetUrlInfo(invitationId string, url string, expiry int64) {
|
||||
id := client.GetConfig().GetIdentity()
|
||||
// lookup for peer with "invitation_id"
|
||||
peer := id.Peers.GetFromInvitationId(invitationId)
|
||||
peer.InvitationUrl = url
|
||||
peer.InvitationExpiry = time.Unix(expiry, 0)
|
||||
id.Peers.StorePeer(peer)
|
||||
|
||||
for i := 0; i < len(client.GetConfig().GetIdentity().Peers); i++ {
|
||||
if client.GetConfig().GetIdentity().Peers[i].InvitationId == invitationId {
|
||||
client.GetConfig().GetIdentity().Peers[i].InvitationUrl = url
|
||||
client.GetConfig().GetIdentity().Peers[i].InvitationExpiry = time.Unix(expiry, 0)
|
||||
break
|
||||
/* for i := 0; i < len(client.GetConfig().GetIdentity().Peers); i++ {
|
||||
if client.GetConfig().GetIdentity().Peers[i].InvitationId == invitationId {
|
||||
client.GetConfig().GetIdentity().Peers[i].InvitationUrl = url
|
||||
client.GetConfig().GetIdentity().Peers[i].InvitationExpiry = time.Unix(expiry, 0)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
client.GetConfig().GetIdentity().Save()
|
||||
client.GetConfig().GetIdentity().Save()*/
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user