Gloox for other purposes than IM
From: Soren Dreijer <dreijerspam@xxxxxxxxxxx>
Date: Mon, 7 Sep 2009 04:05:42 +0200 (CEST)
I just got my hands on gloox today and have been trying to get an overview
of the codebase and how it works. I've come across a few things I was hoping
somebody on this mailing list could be of assistance with:

As you all know, XMPP is so much more than just a chat protocol. However, it
seems the Client and ClientBase classes are tightly coupled with one
purpose: IM support. ClientBase::notifyMessageHandlers(), for instance,
explicitly creates a MessageSession if a session doesn't already exist. When
you subsequently call MessageSession::send(), it specifically crafts a
message meant for chatting, as shown below:

m->addAttribute( "type", "chat" );
Tag *m = new Tag( "message" );

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?

What I like about ClientBase, though, is that "It manages connection
establishing, authentication, filter registration and invocation." [from the
docs], and it would suck if I had to reimplement the entire class just to be
able to send other kinds of messages.

Since I just got my hands on gloox today there might be something I'm
missing. Hopefully some of you guys can help me shed some light on this.

Thanks!