p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional XMPP Programming with JavaScript and jQuery (http://p2p.wrox.com/forumdisplay.php?f=542)
-   -   Groupie - How to create/join a room (http://p2p.wrox.com/showthread.php?t=79400)

yaronfa May 13th, 2010 01:39 PM

Groupie - How to create/join a room
 
Hello and thanks again for this great book :)

I am trying to run the Groupie application against my OpenFire server,
installed on my localhost.

I have followed this post on how to configure apache to redirect calls to OpenFire:
http://www.malcollier.com/?p=14

and it works fine (I am testing stansas with Peek).

I have a problem creating or joining a room. The OpenFire has the MUC service enabled, and I can create rooms through the admin panel.

I have created a room called "room1".

Using Peek, I send this stanza to join this room (my OpenFire server address is "yaron-pc", and the MUC service address is "conference.yaron-pc"

The stanza I send:

"
<presence to="room1@conference.yaron-pc/mynick" from="admin@yaron-pc">
<x xmlns="http://jabber.org/protocol/muc" />
</presence>
"

I am not getting any reply. I have also tried using my full JID in the "from" field. Before I do this, I authenticate myself on the server, and send a regular presence stanza to the server (I apear as online on the admin panel sessions list)

It seems that nothing happens. In the admin panel, the list of Room Occupants is empty.

Thank you in advance

Yaron

cycokris December 2nd, 2010 09:03 PM

I have a similar problem but i think i have yours solved.

In Openfire, hit Group Chat -> Create New Room

let's say your roomID is "public" and room name is "public"
leave the password field blank
fill in the rest however you would like

when you go to login, use your JID like normal
"user@domain"
your normal password for that username as dictated by openfire
"password"
for chatroom you put in (for this case where you made the room known as "public")
"public@conference.serverdomain"
and the nick can be anything

you should be able to see yourself in the admin panel.

However, the problem I have is that nothing happens in the actual chatroom!

Openfire says i'm in the room and that other people are in the room, but groupie does not retrieve and display the messages. I have logged into my account on pidgin and joined the chatroom through pidgin. When i type messages in groupie, they show up in the chatroom on pidgin, so I know that the server and the room setup is correct. There is something amiss in the code that I haven't pinpointed yet. Good luck.

metajack December 4th, 2010 01:14 PM

Quote:

Originally Posted by yaronfa (Post 257833)
The stanza I send:

"
<presence to="room1@conference.yaron-pc/mynick" from="admin@yaron-pc">
<x xmlns="http://jabber.org/protocol/muc" />
</presence>
"

Do not set the 'from' attribute. I included it in the examples in the book so that people would understand who the stanzas are sent from. You'll notice in the book's code I never set this attribute. The server will stamp your stanza with the correct from, and it will ignore or reject anything you set there in most cases.

If that isn't the problem, you might try sending a disco#info query to conference.yaron-pc to see if it responds. If that fails, try sending a disco#info query to yaron-pc. It should list the conference service in a disco#items response as well.

metajack December 4th, 2010 01:15 PM

Quote:

Originally Posted by cycokris (Post 266178)
Openfire says i'm in the room and that other people are in the room, but groupie does not retrieve and display the messages. I have logged into my account on pidgin and joined the chatroom through pidgin. When i type messages in groupie, they show up in the chatroom on pidgin, so I know that the server and the room setup is correct. There is something amiss in the code that I haven't pinpointed yet. Good luck.

Please try the latest version of the code at https://github.com/metajack/profxmpp

It's possible this bug has been fixed. If that doesn't help, let me know, and I'll try and track down what's going wrong.

cycokris December 14th, 2010 05:58 PM

Thank you that worked.


All times are GMT -4. The time now is 06:11 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.