// Function wrap message in multiple route.
// Need use pseudo sender if route not null.
Function wrap message in multiple route.
Need use pseudo sender if route not null.
// Function wrap message in multiple route . // Need use pseudo sender if route not null .
func (client *Client) RouteMessage(msg *Message, route *Route) *Message {
	var (
		rmsg    = client.Encrypt(route.receiver, msg)
		psender = NewClient(route.psender)
	)
	if psender == nil && len(route.routes) != 0 {
		return nil
	}
	diff := uint(msg.Head.Diff)
	for _, pub := range route.routes {
		pack := rmsg.Serialize()
		rmsg = psender.Encrypt(
			pub,
			NewMessage(
				gopeer.Get("ROUTE_MSG").([]byte),
				pack.Bytes(),
				diff,
			),
		)
	}
	return rmsg
}
func ( client * Client ) RouteMessage ( msg * Message , route * Route ) * Message { var ( rmsg = client . Encrypt ( route . receiver , msg ) psender = NewClient ( route . psender ) ) if psender == nil && len ( route . routes ) != 0 { return nil } diff := uint ( msg . Head . Diff ) for _ , pub := range route . routes { pack := rmsg . Serialize ( ) rmsg = psender . Encrypt ( pub , NewMessage ( gopeer . Get ( " " ) . ( [ ] byte ) , pack . Bytes ( ) , diff , ) , ) } return rmsg }
Function wrap message in multiple route.
Function wrap message in multiple route .