Server invitation process functions
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -97,6 +97,7 @@ func (ints *Server) BuildMessageRequestMessage(lookupKeys []string) ([]byte, err
|
||||
}
|
||||
|
||||
// BuildToServerMessageInvitation creates an invitation message to server and returns it as a meowlib.ToServerMessage
|
||||
// it takes as input a contactcard generated by Identity.InvitePeer
|
||||
func (ints *Server) BuildToServerMessageInvitationCreation(invitation *meowlib.ContactCard, password string, timeout int, invitationIdLen int) (*meowlib.ToServerMessage, error) {
|
||||
var msg meowlib.ToServerMessage
|
||||
var inv meowlib.Invitation
|
||||
@ -109,21 +110,21 @@ func (ints *Server) BuildToServerMessageInvitationCreation(invitation *meowlib.C
|
||||
inv.Step = 1
|
||||
inv.Password = password
|
||||
inv.Timeout = int32(timeout)
|
||||
inv.Idlen = int32(invitationIdLen)
|
||||
inv.ShortcodeLen = int32(invitationIdLen)
|
||||
inv.Payload = payload
|
||||
msg.Invitation = &inv
|
||||
return &msg, nil
|
||||
}
|
||||
|
||||
// BuildToServerMessageInvitationRequest requests invitation with provided id from server and returns it as a meowlib.ToServerMessage
|
||||
func (ints *Server) BuildToServerMessageInvitationRequest(invitationId string, password string) (*meowlib.ToServerMessage, error) {
|
||||
func (ints *Server) BuildToServerMessageInvitationRequest(shortcode string, password string) (*meowlib.ToServerMessage, error) {
|
||||
var msg meowlib.ToServerMessage
|
||||
var inv meowlib.Invitation
|
||||
msg.Type = "1"
|
||||
msg.From = ints.Me.Public
|
||||
inv.Step = 2
|
||||
inv.Password = password
|
||||
inv.Id = invitationId
|
||||
inv.Shortcode = shortcode
|
||||
msg.Invitation = &inv
|
||||
return &msg, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user