Problem creating chat on openfire server

When I try to create a room in multi-user chat (MUC), the server replies: "This room is locked from recording to configuration confirmation." How can I overcome this?

Thank you in advance

+4
source share
2 answers

You need to send a configuration form for the room. If you use smack, the code will look something like this:

Form submitForm = multiUserChat.getConfigurationForm().createAnswerForm(); submitForm.setAnswer("muc#roomconfig_publicroom", false); submitForm.setAnswer("muc#roomconfig_roomname", room); multiUserChat.sendConfigurationForm(submitForm); 
+7
source

I am having a problem using Candy Chat 1.7.1 with Openfire 3.9.3.

It took me a while to figure it out, but after reading the multiplayer chat spec: http://xmpp.org/extensions/xep-0045.html#createroom

In the end I decided this; first with Strophe, then from the found Candy path.

So, to answer your question:

At Strophe

After creating a room, sending a presence (example 153 in the specification)

I sent below (according to example 155 in the specification)

 conn.sendIQ($iq({ type: "set", to: escapedRoomId, from: me.getEscapedJid(), id: "create:" + conn.getUniqueId() }).c("query", { xmlns: "http://jabber.org/protocol/muc#owner" }).c("x", { xmlns: "jabber:x:data", type: "submit" })); 

where conn is Strophe.Connection

Then, to help others who may have the same problem in Candy Chat:

Chatting Candy

After searching for the bits of the Strop message above in the candy libs package, I found this:

 createInstantRoom: function(room, success_cb, error_cb) { var roomiq; roomiq = $iq({ to: room, type: "set" }).c("query", { xmlns: Strophe.NS.MUC_OWNER }).c("x", { xmlns: "jabber:x:data", type: "submit" }); return this._connection.sendIQ(roomiq.tree(), success_cb, error_cb); }, 

So this solves it in Candy Chat.

 $(Candy).on('candy:view.room.after-add', function(evt, args) { Candy.Core.getConnection().muc.createInstantRoom(Candy.Util.escapeJid(args.roomJid)); }); 

Annoyingly simple when you know how to do it. By the way, I think this method should be called configureAsInstantRoom, and for Candy chat there should be an option for this init method or similar.

+1
source

Source: https://habr.com/ru/post/1369669/


All Articles