Quoting Soren Dreijer <dreijerspam@xxxxxxxxxxx>:
Since the type of session is hardcoded into ClientBase, there's no way for
me to change this behavior by deriving from MessageSession and overriding
its send() method (at least not as far as I've been able to see). If I
wanted to set a different message type, or just send a message with some
other properties, how should I do it?
You're right that MessageSessions are intended primarily for IM.
There's no way to change that at the moment. However, you don't have
to use a MessageSession to send/receive messages. Using
ClientBase::registerMessageSessionHandler() is optional and you'll
receive messages using 'ordinary' MessageHandlers directly from
ClientBase (use ClientBase::registerMessageHandler() to register a
MessageHandler). You can send messages (any type of stanzas, for that
matter) without a MessageSession using ClientBase::send().
cheers,
Jakob