K
K
kill_windows2014-09-07 20:31:50
XMPP
kill_windows, 2014-09-07 20:31:50

Groups in XMPP/ MUC XMPP ?

Who worked with MUC XMPP, tell me "How to join a group and send / receive a message from this group"?
I use Strophe + openfire.
I have already learned how to communicate with other users directly, how to do it in a general chat xs.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kill_windows, 2014-09-07
@kill_windows

Here's what I got.

var o = {to:'имя_комнаты@доммен/ник_в_комнате'}; 
var m = $pres(o); 
m.c('x', {xmlns : 'http://jabber.org/protocol/muc#user'}, null); 
connection.send(m.tree());

If the room is password protected
var o = {to:'имя_комнаты@доммен/ник_в_комнате'}; 
var m = $pres(o); 
m.c('x', {xmlns : 'http://jabber.org/protocol/muc#user'}, null).c('password', null, 'pass'); 
connection.send(m.tree());

var o = {to:'имя_комнаты@доммен', type : 'groupchat'}; 
var m = $msg(o); m.c('body', null, 'hello'); 
connection.send(m.tree());

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question