This commit is contained in:
@ -33,6 +33,7 @@ type Server struct {
|
||||
Country string `json:"country,omitempty"`
|
||||
AllowedDelay int `json:"allowed_delay,omitempty"`
|
||||
Backup bool `json:"backup,omitempty"`
|
||||
WebRTC bool `json:"webrtc,omitempty"`
|
||||
}
|
||||
|
||||
// CreateServerFromUrl creates a server from a basic url, ex : https://my.meowserver.example:8443/meow/
|
||||
@ -152,6 +153,7 @@ func (ints *Server) BuildMessageSendingMessage(usermsg *meowlib.PackedUserMessag
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ! Unfinished unused ?
|
||||
// BuildMessageRequestMessage creates a message lookup message to server and returns it as protobuf serialized byte array
|
||||
func (ints *Server) BuildMessageRequestMessage(lookupKeys []string) ([]byte, error) {
|
||||
var msg meowlib.ToServerMessage
|
||||
@ -165,6 +167,27 @@ func (ints *Server) BuildMessageRequestMessage(lookupKeys []string) ([]byte, err
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// BuildVideoRoomRequestMessage creates a video room request to server and returns it as protobuf serialized byte array
|
||||
func (ints *Server) BuildVideoRoomRequestMessage(users []string, expiry uint64) ([]byte, error) {
|
||||
var msg meowlib.ToServerMessage
|
||||
msg.Uuid = uuid.New().String()
|
||||
msg.Type = "1"
|
||||
msg.From = ints.UserKp.Public
|
||||
// declare an array of meow.VideoCredential
|
||||
videocreds := make([]*meowlib.VideoCredential, len(users))
|
||||
for idx := range users {
|
||||
videocreds[idx] = &meowlib.VideoCredential{
|
||||
Username: users[idx],
|
||||
}
|
||||
}
|
||||
msg.VideoData.Credentials = videocreds
|
||||
out, err := proto.Marshal(&msg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// 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, shortCodeLen int) (*meowlib.ToServerMessage, error) {
|
||||
|
Reference in New Issue
Block a user