2
votes

I've managed to get a converse.js v.0.9.0 client working with an openfire server I have on a Debian machine.

The connection works just fine, I've created a couple of users to test things out and everything was working fine, I could login, make private conversations between users even create rooms, which were listed properly when clicking the "list rooms" button.

The problem came when a user wanted to join a room another user created. When doing so, the window with the room name popped properly but the users list in that room was empty and communication didn't exist at all (no one could see each others messages on that room).

I took a look on the openfire admin panel and in the conference server the room was properly displayed but only with 1 user in it.

Is this a problem with the openfire conference server configuration? or is it the converse client that needs an extra module for room chats?

I'l put the code of the test page to see if it can help.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>prueba</title>
    <link rel="stylesheet" type="text/css" media="screen" href="css/converse.css">
    <script src="builds/converse.js"></script>
</head>
<body>

</body>
<script>
    require(['converse'], function (converse) {
 converse.initialize({
 auto_list_rooms: false,
 auto_subscribe: false,
 bosh_service_url: 'http://converse:7070/http-bind/', 
 hide_muc_server: false,
 i18n: locales.en, 
 prebind: false,
 show_controlbox_by_default: true,
 roster_groups: true
 });
});
</script>
</html>
1
I've continued doing some research to see what could be failing. I'm a bit new to this so its taking me some time. The first thing I did is look into the log to see if I was having any error and I got this: org.jivesoftware.openfire.spi.ConnectionManagerImpl - No se pudo establecer un socket de servidor wich can be translated into this: org.jivesoftware.openfire.spi.ConnectionManagerImpl - server socked could not be stablished Also I tried to install a muc plugin, is that necessary with Openfire 3.9.3? or does it come as a default service.Failon

1 Answers

1
votes

Solved! The problem was the rooms options.

There are several ways to perform .join into a MUC (multi user chat) I'l quote Ignite Realtime on this:

// Create a MultiUserChat using a XMPPConnection for a room MultiUserChat muc2 = new MultiUserChat(conn1, "[email protected]");

// User2 joins the new room

// The room service will decide the amount of history to send

muc2.join("testbot2");

In this example we can see how to join a room with a given nickname and password:

// User2 joins the new room using a password // The room service will decide the amount of history to send

muc2.join("testbot2", "password");

In this example we can see how to join a room with a given nickname specifying the amount of history to receive:

// User2 joins the new room using a password and specifying // the amount of history to receive. In this example we are requesting the last 5 messages. DiscussionHistory history = new DiscussionHistory(); history.setMaxStanzas(5);

muc2.join("testbot2", "password", history, conn1.getPacketReplyTimeout());

So my guess is that Converse Join function is formated only on the first way (the one with only the string parameters) and when I check further options in the server probably the overrided function wich ask for more parameters was denying converse the possibility to execute its join function wich only had one parameter.