0

I'm using xmpp4r with Rails 4 to implement a real-time web chat system. The XMPP server is Openfire and I'm using converse.js for the web client part. The problem is the following: when I login through the converse.js widget, the client is connecting (I can see it is online through the Openfire interface) but I can't send/receive messages to/from other accounts. Creating a group through the Openfire web interface and adding both users I want to use to the same group solved this problem and now I can communicate correctly. Now my questions are:

  1. Should I create a new group for each user that signs up on my site? This group will contain his friends so he can chat with them (I'm pretty sure the answer to this question is yes)
  2. How to create such a group automatically from code using xmpp4r?
The Coding Monk
  • 7,684
  • 12
  • 41
  • 56
  • So are you not able to see the users in your roster at all? Or is it that you see them but can't send messages? – coderhs Sep 05 '14 at 14:45
  • The roster is actually empty unless I add this user to the group, then all the users of the group are in the roster and I can see them. Do I have to populate the roster using groups or am I doing this wrong? – The Coding Monk Sep 05 '14 at 14:50
  • You will have to populate them. You need to create a group and add these users to that group. You will need to make XMPP4R send a query to create a group http://www.profanity.im/reference.html#group – coderhs Sep 05 '14 at 14:53
  • Ok, then, is there a way to create a new group and populate it using xmpp4r? I can't find any info about it. – The Coding Monk Sep 05 '14 at 14:59
  • As per this line (https://github.com/xmpp4r/xmpp4r/blob/master/lib/xmpp4r/roster/iq/roster.rb#L204) you can add groups to which the user belongs to by just passing in the array. – coderhs Sep 05 '14 at 15:08

0 Answers0