keypair err mgt + shorturl random improve
This commit is contained in:
@@ -24,7 +24,10 @@ func InvitationAnswer(cc *meowlib.ContactCard, nickname string, myNickname strin
|
||||
}
|
||||
|
||||
// build my contact card for that friend
|
||||
peer := client.GetConfig().GetIdentity().AnswerInvitation(mynick, nickname, serverUids, cc)
|
||||
peer, err := client.GetConfig().GetIdentity().AnswerInvitation(mynick, nickname, serverUids, cc)
|
||||
if err != nil {
|
||||
return nil, "InvitationAnswer: AnswerInvitation", err
|
||||
}
|
||||
|
||||
//peerstr, err := json.Marshal(peer)
|
||||
//fmt.Println("InvitationAnswer: " + string(peerstr))
|
||||
@@ -71,7 +74,10 @@ func InvitationAnswerFile(invitationFile string, nickname string, myNickname str
|
||||
mynick = client.GetConfig().GetIdentity().Nickname
|
||||
}
|
||||
|
||||
response := identity.AnswerInvitation(mynick, nickname, serverUids, cc)
|
||||
response, err := identity.AnswerInvitation(mynick, nickname, serverUids, cc)
|
||||
if err != nil {
|
||||
return "InvitationAnswerFile : AnswerInvitation", err
|
||||
}
|
||||
fmt.Fprintln(os.Stdout, "Invitation sent by "+received)
|
||||
if format == "qr" {
|
||||
filename = c.StoragePath + string(os.PathSeparator) + mynick + "-" + nickname + ".png"
|
||||
|
||||
@@ -64,7 +64,10 @@ func InvitationGetMessage(invitationUrl string, serverPublicKey string, invitati
|
||||
meowurl := strings.Split(invitationUrl, "?")
|
||||
|
||||
shortcode := meowurl[1]
|
||||
srv := client.CreateServerFromMeowUrl(meowurl[0])
|
||||
srv, err := client.CreateServerFromMeowUrl(meowurl[0])
|
||||
if err != nil {
|
||||
return nil, "InvitationGetMessage: CreateServerFromMeowUrl", err
|
||||
}
|
||||
// check if already in msg servers
|
||||
dbsrv, err := client.GetConfig().GetIdentity().MessageServers.LoadServer(srv.Url)
|
||||
if err != nil {
|
||||
@@ -73,7 +76,11 @@ func InvitationGetMessage(invitationUrl string, serverPublicKey string, invitati
|
||||
if dbsrv == nil {
|
||||
// create a server object with url & pubkey
|
||||
srv.PublicKey = serverPublicKey
|
||||
srv.UserKp = meowlib.NewKeyPair()
|
||||
k, err := meowlib.NewKeyPair()
|
||||
if err != nil {
|
||||
return nil, "InvitationGetMessage: NewKeyPair", err
|
||||
}
|
||||
srv.UserKp = k
|
||||
// save it
|
||||
err = client.GetConfig().GetIdentity().MessageServers.StoreServer(srv)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user