librelist archives

« back to archive

Creating Private Chat Rooms via Code

Creating Private Chat Rooms via Code

From:
Gauri Padbidri
Date:
2015-02-25 @ 20:37
Hi,

 

I have been able to tweak the code to launch a Chat Room from a single user
chat. The Chat Room opens with the logged in user as an occupant of the
Chatroom. I have the following issues : 

 

1.       How can I SET the created Chat Room to be PRIVATE from within the
code, as I do not want the Chat room to be publically discoverable ?

2.       How can I add multiple users automatically when the Chat Room
launches ? This is for the following scenario : 

"User1" logs in -> Clicks on "User2" for 1-1 chat. Now "User1" clicks on the
"+" icon on "User2" Chat Box Header. -> Chat Room opens with ONLY "User1" as
an occupant. How can I make "User2" also a participant ? 

3.       Considering #2, going ahead I want a minimum of 3 users for the
Chat room, so how can I register 2 more users to the Chat room via CODE ?

 

NOTE  : Once I have the code well tested and in place I would like to
contribute this code as well. 

 

Thanks for your support. Kindly help me again. Thanks !

 

Best Regards,

Gauri Padbidri

Re: [conversejs] Creating Private Chat Rooms via Code

From:
Jc Brand
Date:
2015-02-26 @ 10:14
On Thu, Feb 26, 2015 at 02:07:47AM +0530, Gauri Padbidri wrote:
>    Hi,
> 
>    I have been able to tweak the code to launch a Chat Room from a single
>    user chat. The Chat Room opens with the logged in user as an occupant of
>    the Chatroom. I have the following issues :
> 
>    1.       How can I SET the created Chat Room to be PRIVATE from within the
>    code, as I do not want the Chat room to be publically discoverable ?

AFAIK, you cannot make a room private, you can only protect it with a password.
In converse.js the user can do this manually by clicking on the wrench icon on
a room and submitting a form.

If you want to do it automatically you'll have to write custom code for it.

>    2.       How can I add multiple users automatically when the Chat Room
>    launches ? This is for the following scenario :
> 
>    “User1” logs in -> Clicks on “User2” for 1-1 chat. Now “User1” clicks on
>    the “+” icon on “User2” Chat Box Header. -> Chat Room opens with ONLY
>    “User1” as an occupant. How can I make “User2” also a participant ?

The protocol I linked to last time explained how that is supposed to work. You
cannot automatically make them join, you can only invite them.

http://xmpp.org/extensions/xep-0045.html#continue

Converse.js already supports inviting users to a room, so you can reuse some of
that code.

In your case, you want to send out the invites automatically. 
  
>    3.       Considering #2, going ahead I want a minimum of 3 users for the
>    Chat room, so how can I register 2 more users to the Chat room via CODE ?

As explained above, you can't, you can only invite them.

>    NOTE  : Once I have the code well tested and in place I would like to
>    contribute this code as well.

Thanks.

JC