package helpers import ( "forge.redroom.link/yves/meowlib" "forge.redroom.link/yves/meowlib/client" ) func HttpSendMessage(serverUid string, message []byte, timeout int) ([]byte, error) { id := client.GetConfig().GetIdentity() srv, err := id.MessageServers.LoadServer(serverUid) if err != nil { return nil, err } // gettig server Public key if missing if srv.PublicKey == "" { srvdata, err := meowlib.HttpGetId(srv.Url) if err != nil { return nil, err } //print(srvdata["publicKey"]) srv.PublicKey = srvdata["publicKey"] id.MessageServers.StoreServer(srv) } response, err := meowlib.HttpPostMessage(srv.Url, message, timeout) if err != nil { return nil, err } return response, nil }