title: presence issue using ejabberd, strophe.js, strophe.muc.js and strophe.roster.js
body: <p>I have an ejabberd server and would like to write a web chat client for it. I've looked at things like Candy but they are a little over the top for what I want to do. I just want some basic features like instant messaging, group chat and presence.</p>
  
  <p>I used the basic.html and basic.js example files from strophejs-1.0.2 as my base. I've managed to make a connection to my jabber server, join a conference, "try and send a message", leave the conference, and send an instant message to me. Most of that is working.</p>
  
  <p>The issue I have is when the user logs in and joins a conference it tries to post a message to the group but fails.</p>
  
  <pre><code>&lt;message xmlns="jabber:client" from="test@conference.jabber.example.com" to="user@jabber.example.com/27311205821380711229538600" type="error"&gt;
  &lt;body&gt;test2&lt;/body&gt;
  &lt;error code="406" type="modify"&gt;
  &lt;not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"&gt;&lt;/not-acceptable&gt;
  &lt;text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"&gt;It is not allowed to send private messages to the conference&lt;/text&gt;
  &lt;/error&gt;
  &lt;/message&gt;
  </code></pre>
  
  <p>If I log into the conference as myself using Pidgin I can see the user in the conference. It has an icon next to it's name which has a dot and a number of circles around it. If I right-click on the user it says the user Status is Offline. This is strange as the user is online. If I look at the admin console for ejabberd I see the user is online. I have tried manually setting the presence like this before the user joins the conference:</p>
  
  <pre><code>connection.send($pres({type: "Available"}));
  </code></pre>
  
  <p>with this result:</p>
  
  <pre><code>&lt;presence xmlns="jabber:client" from="user@jabber.example.com/27311205821380711229538600" to="user@jabber.example.com/27311205821380711229538600" type="Available"&gt;&lt;/presence&gt;
  </code></pre>
  
  <p>Still the user has a status as Offline.</p>
  
  <p>The IM it sends me when it's online is in red text in Pidgin. Normal messages look blue. I assume this is because it thinks the user is Offline.</p>
  
  <p>I'm a little stuck. I wonder if someone can help me or point me in the right direction? I would firstly like to work out why this user looks Offline when it doesn't seem to be and fix it.</p>
  
  <p>I've been looking at documentation about how to query the roster. I haven't had much success with this as well. I'm looking for a very basic example to show which users are online and their status with a call back to update if there are changes.</p>
  
  <p>Can someone help me please?</p>