powered by Jive Software

Invite to chat


I’‘m quite new to the smack library but I’'ve already got a lot of stuff working and am having great fun. Keep up the good work!

My question:

I’‘m would like to send a chat invitation and don’'t really know how to go about this… Do I have to modify a message?

Can anyone give me any pointers?

thanx very much!


I actually have this new feature request already logged under the ID SMACK-37 (http://www.jivesoftware.com/issues). Currently, you’'d do something like the following:

Packet invite = new Packet() {
    public String toXML() {
        return "<message from=''joe@example.com'' to=''mary@example.com''>" +
            "<body>Chat invitation.</body>" +
            "<x jid=''room@service'' xmlns=''jabber:x:conference''/>" +

This works with most current clients. However, according to the MUC JEP (http://www.jabber.org/jeps/jep-0045.html), this protocol should be phazed out over time so that official MUC invites can be used (see the JEP for more info).

So, I’‘m not sure what the official Smack solution will be. Likely, we’'ll implement the full MUC protocol all at once and include invites as a feature.