<p>The JSON data contains the user’s JID (jabber ID), RID and SID. The URL to the
BOSH connection manager is already set as a configuration setting on the
<em>converse</em> object (see ./main.js), so we can reuse it from there.</p>
<p>A new Strophe.Connection object is instantiated and then <em>attach</em> is called with
the user’s JID, the necessary tokens and a callback function.</p>
<p>In the callback function, you call <em>converse.onConnected</em> together with the
connection object.</p>
<p>The JSON data contains the user’s JID (jabber ID), RID, SID and the URL to the
BOSH connection manager.</p>
</div>
</div>
<divclass="section"id="facebook-integration">
...
...
@@ -450,40 +448,37 @@ a middle man between HTTP and XMPP.</p>
</div>
<divclass="section"id="fullname">
<h3><aclass="toc-backref"href="#id27">fullname</a><aclass="headerlink"href="#fullname"title="Permalink to this headline">¶</a></h3>
<p>If you are using prebinding, you need to specify the fullname of the currently
logged in user.</p>
<p>If you are using prebinding, can specify the fullname of the currently
logged in user, otherwise the user’s vCard will be fetched.</p>
</div>
<divclass="section"id="hide-muc-server">
<h3><aclass="toc-backref"href="#id28">hide_muc_server</a><aclass="headerlink"href="#hide-muc-server"title="Permalink to this headline">¶</a></h3>
<p>Default = False</p>
<p>Default = false</p>
<p>Hide the <ttclass="docutils literal"><spanclass="pre">server</span></tt> input field of the form inside the <ttclass="docutils literal"><spanclass="pre">Room</span></tt> panel of the
controlbox. Useful if you want to restrict users to a specific XMPP server of
your choosing.</p>
</div>
<divclass="section"id="i18n">
<h3><aclass="toc-backref"href="#id29">i18n</a><aclass="headerlink"href="#i18n"title="Permalink to this headline">¶</a></h3>
<p>Specify the locale/language. The language must be in the <ttclass="docutils literal"><spanclass="pre">locales</span></tt> object. Refer to
<ttclass="docutils literal"><spanclass="pre">./locale/locales.js</span></tt> to see which locales are supported.</p>
</div>
<divclass="section"id="prebind">
<h3><aclass="toc-backref"href="#id29">prebind</a><aclass="headerlink"href="#prebind"title="Permalink to this headline">¶</a></h3>
<p>Default = False</p>
<h3><aclass="toc-backref"href="#id30">prebind</a><aclass="headerlink"href="#prebind"title="Permalink to this headline">¶</a></h3>
<p>Default = false</p>
<p>Use this option when you want to attach to an existing XMPP connection that was
already authenticated (usually on the backend before page load).</p>
<p>This is useful when you don’t want to render the login form on the chat control
box with each page load.</p>
<p>When set to true, you’ll need to make sure that the onConnected method is
called, and passed to it a Strophe connection object.</p>
<p>Besides requiring the back-end to authenticate you, you’ll also
have to write a Javascript snippet to attach to the set up connection:</p>
<divclass="highlight-python"><pre>$.JSON({
'url': 'mysite.com/xmpp-authenticate',
'success': function (data) {
connection = new Strophe.Connection(bosh_service_url);
<p>The backend must authenticate for you, and then return a SID (session ID) and
RID (Request ID), which you use when you attach to the connection.</p>
<p>For prebinding to work, your backend server must authenticate for you, and
then return a JID (jabber ID), SID (session ID) and RID (Request ID).</p>
<p>If you set <ttclass="docutils literal"><spanclass="pre">prebind</span></tt> to <ttclass="docutils literal"><spanclass="pre">true</span></tt>, you have to make sure to also pass in these
values as <ttclass="docutils literal"><spanclass="pre">jid</span></tt>, <ttclass="docutils literal"><spanclass="pre">sid</span></tt>, <ttclass="docutils literal"><spanclass="pre">rid</span></tt>.</p>
<p>Additionally, you have to specify <ttclass="docutils literal"><spanclass="pre">bosh_service_url</span></tt>.</p>
<h3><aclass="toc-backref"href="#id30">show_controlbox_by_default</a><aclass="headerlink"href="#show-controlbox-by-default"title="Permalink to this headline">¶</a></h3>
<p>Default = False</p>
<h3><aclass="toc-backref"href="#id31">show_controlbox_by_default</a><aclass="headerlink"href="#show-controlbox-by-default"title="Permalink to this headline">¶</a></h3>
<p>Default = false</p>
<p>The “controlbox” refers to the special chatbox containing your contacts roster,
status widget, chatrooms and other controls.</p>
<p>By default this box is hidden and can be toggled by clicking on any element in
...
...
@@ -492,7 +487,7 @@ the page with class <em>toggle-online-users</em>.</p>
page load.</p>
</div>
<divclass="section"id="xhr-user-search">
<h3><aclass="toc-backref"href="#id31">xhr_user_search</a><aclass="headerlink"href="#xhr-user-search"title="Permalink to this headline">¶</a></h3>
<h3><aclass="toc-backref"href="#id32">xhr_user_search</a><aclass="headerlink"href="#xhr-user-search"title="Permalink to this headline">¶</a></h3>
<p>Default = False</p>
<p>There are two ways to add users.</p>
<ulclass="simple">
...
...
@@ -505,9 +500,9 @@ be used.</p>
</div>
</div>
<divclass="section"id="minification">
<h1><aclass="toc-backref"href="#id32">Minification</a><aclass="headerlink"href="#minification"title="Permalink to this headline">¶</a></h1>
<h1><aclass="toc-backref"href="#id33">Minification</a><aclass="headerlink"href="#minification"title="Permalink to this headline">¶</a></h1>
<h2><aclass="toc-backref"href="#id33">Minifying Javascript and CSS</a><aclass="headerlink"href="#minifying-javascript-and-css"title="Permalink to this headline">¶</a></h2>
<h2><aclass="toc-backref"href="#id34">Minifying Javascript and CSS</a><aclass="headerlink"href="#minifying-javascript-and-css"title="Permalink to this headline">¶</a></h2>
<p>Please make sure to read the section <aclass="reference internal"href="#development">Development</a> and that you have installed
all development dependencies (long story short, you can run <ttclass="docutils literal"><spanclass="pre">npm</span><spanclass="pre">install</span></tt>
and then <ttclass="docutils literal"><spanclass="pre">grunt</span><spanclass="pre">fetch</span></tt>).</p>
...
...
@@ -523,7 +518,7 @@ You can <a class="reference external" href="http://requirejs.org/docs/optimizati
</div>
</div>
<divclass="section"id="translations">
<h1><aclass="toc-backref"href="#id34">Translations</a><aclass="headerlink"href="#translations"title="Permalink to this headline">¶</a></h1>
<h1><aclass="toc-backref"href="#id35">Translations</a><aclass="headerlink"href="#translations"title="Permalink to this headline">¶</a></h1>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">Translations take up a lot of space and will bloat your minified file.