cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2753
Views
1
Helpful
6
Replies

XMPP API - Persistent Chat

tpouliot
Cisco Employee
Cisco Employee

     Is there any examples of using the XMPP API to create and manage Persistent Chat rooms?  Customer is deploying Persistent Chat for Mac and there is no admin controls.  Running the Windows client is not an option. 

6 Replies 6

npetrele
Cisco Employee
Cisco Employee

There's no sample app with a persistent chat room administration interface, if that's what you mean. There is a sample app for chat rooms, though.  You can find it in doc/examples/mucexample.html.  There's also doc/examples/mucviewdemo.html for the built-in UI. I'm writing a new demo, but the chat room features aren't finished yet.


If you're going to use persistent chat rooms, make sure you enable the feature in the Cisco IM&P server UI.

Thank you. We are looking for the best way to manage chat rooms (admin interface) in a Mac environment.  We have Persistent Chat already up and running.  Since the Mac community can not get admin rights, we are looking at our options.  I will check out the example, but do you think it is possible to have some web front end for room generation and other admin rights that we can manage through Safari or Firefox?  We don't necessarily want to create a whole app, if we can deliver some level of admin via a web front end.

I haven't gotten deep enough into my demo to be able to tell you with 100% certainty, but I'm reasonably sure there's no friendly interface in the Jabber SDK for differentiating between persistent and temporary chat rooms.  I believe they're all temporary by default. It would be nice if there were something like room.setPersistent(params), but there's nothing like that I can see.

However, the SDK does include everything you need to build your own requests to create persistent chat rooms.  In particular, you'd want to check out:

jabberwerx.MUCRoom.applyConfig(configForm, configCallback)


...where configForm points to an XDataForm...


jabberwerx.XDataForm

jabberwerx.XDataFormField

..which you'd manipulate according to the specification here, e.g. 10.1.3 of this...

XEP-0045: Multi-User Chat

So the answer is, yes, you can do it with any decent browser and the Jabber SDK.  I will be building this into my Demo, but that won't be ready soon.

Hello,

I've figured out how to create a persistent chat with jabberwerx. When entering a room you have to pass an object with configureCallback function. Inside this function you can create a XDataForm and append a couple of fields (not sure that both are nessessary)

Here is the source:

jabberwerx._config.unsecureAllowed = true;

jabberwerx.$(document).ready(function() {

    var client = new jabberwerx.Client('web-chat');

    var control= new jabberwerx.MUCController(client);

    client.connect('user@example.com','pass', {

            httpBindingURL: "https://cup.example.com:7335/httpbinding",

            successCallback: function success() {

                jabberwerx.$("#log").append("<br/> Connected");

                this;

                },

            errorCallback:  function(err) {

                var tstr = jabberwerx.util.serializeXML(err);

                jabberwerx.util.debug.warn(tstr);

                jabberwerx.$("#log").text("Could not connect: " + tstr+ " Errcode=2");

                }

            });

      

    client.event("clientStatusChanged").bind(function(evt) {

        if (evt.data.next == jabberwerx.Client.status_connected) { 

                var room=control.room('new_room@you_persistent_allias.com');

                room.enter('smirnov-am',{

                        successCallback: function success() {

                            jabberwerx.$("#log").append("<br/> Entered room "+chats[i]);

                            this.exit();                                                                                   

                        },

                        errorCallback: function(err, aborted) {

                            jabberwerx.$("#log").text("Could not enter:");                                

                        },

                        configureCallback: function() {

                            var form=new jabberwerx.XDataForm("submit");

                            form.setFieldValue("muc#roomconfig_persistentroom","1","boolean");

                            form.setFieldValue("persistent","1","boolean");

                            this.applyConfig(form);

                        }                    

                    });

    });

I've used it to create more then 1000 persistent rooms - saved me a lot of time.

Excellent!!  Thanks for sharing that code!

zerez
Level 1
Level 1

Hi all,

how can I get all the created persistent rooms using the SDK ?

I want to show a list of rooms to the user , even those he created before.