Message plug_msg;
if( message instanceof MessageAdapter ) { //original message created by plugin, unwrap
plug_msg = ((MessageAdapter)message).getPluginMessage();
}
else {
plug_msg = new MessageAdapter( message ); //core created
}
RawMessage raw_plug = plug_encoder.encodeMessage( plug_msg );
return new com.aelitis.azureus.core.networkmanager.RawMessage[]{ new RawMessageAdapter( raw_plug )};