return new RawMessage[] {BTMessageFactory.createBTRawMessage(message)};
}
// What type of message is it? LT_handshake messages are always straight forward.
if (message instanceof LTHandshake) {
return new RawMessage[] {BTMessageFactory.createBTRawMessage(new BTLTMessage(message, (byte)0))};
}
// Other message types have to be matched up against the appropriate ID.
if (extension_map != null) {
Byte ext_id = (Byte)this.extension_map.get(message.getID());
if (ext_id != null) {
//Logger.log(new LogEvent(this.log_object, LOGID, "Converting LT message to BT message, ext id is " + ext_id));
return new RawMessage[] {BTMessageFactory.createBTRawMessage(new BTLTMessage(message, ext_id.byteValue()))};
}
}
// Anything else means that the client doesn't support that extension.
// We'll drop the message instead.