configuration.rst 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587
  1. .. raw:: html
  2. <div id="banner"><a href="https://github.com/jcbrand/converse.js/blob/master/docs/source/configuration.rst">Edit me on GitHub</a></div>
  3. =============
  4. Configuration
  5. =============
  6. The included minified JavaScript and CSS files can be used for demoing or testing, but
  7. you'll want to configure *Converse* to suit your needs before you deploy it
  8. on your website.
  9. *Converse* is passed its configuration settings when you call its *initialize* method.
  10. You'll most likely want to call the *initialize* method in your HTML page. For
  11. an example of how this is done, please see the bottom of the *./index.html* page.
  12. Please refer to the `Configuration settings`_ section below for info on
  13. all the available configuration settings.
  14. After you have configured *Converse*, you'll have to regenerate the minified
  15. JavaScript file so that it will include the new settings. Please refer to the
  16. :ref:`minification` section for more info on how to do this.
  17. .. _`configuration-settings`:
  18. Configuration settings
  19. ======================
  20. authentication
  21. --------------
  22. * Default: ``login``
  23. * Allowed values: `login`_, `external`, `anonymous`_, `prebind`_
  24. This option states the way Converse will authenticate.
  25. login
  26. ~~~~~
  27. The default means is ``login``, which means that the user either logs in manually with their
  28. username and password, or automatically if used together with ``auto_login=true``
  29. and ``jid`` and ``password`` values. See `auto_login`_.
  30. external
  31. ~~~~~~~~
  32. This setting will still show a login form and submit button, but the form will
  33. only contain an input for the user's JID, *not* for the password.
  34. That's because this setting is intended to be used when you are using
  35. SASL-EXTERNAL as authentication mechanism, in which case a password is usually
  36. not required.
  37. SASL-EXTERNAL is generally used together with x509 client certificates to
  38. enable passwordless login or 2-factor authentication.
  39. For more details on this, `read this blog post <https://opkode.com/blog/strophe_converse_sasl_external/>`_.
  40. anonymous
  41. ~~~~~~~~~
  42. This enables anonymous login if the XMPP server supports it. This option can be
  43. used together with `auto_login`_ to automatically and anonymously log a user in
  44. as soon as the page loads.
  45. The server's domain is passed in via the `jid`_ setting.
  46. prebind
  47. ~~~~~~~
  48. See also: :ref:`session-support`
  49. Use this option when you want to attach to an existing XMPP
  50. `BOSH <https://en.wikipedia.org/wiki/BOSH>`_ session.
  51. Usually a BOSH session is set up server-side in your web app.
  52. Attaching to an existing BOSH session that was set up server-side is useful
  53. when you want to maintain a persistent single session for your users instead of
  54. requiring them to log in manually.
  55. When a BOSH session is initially created, you'll receive three tokens.
  56. A JID (jabber ID), SID (session ID) and RID (Request ID).
  57. Converse needs these tokens in order to attach to that same session.
  58. There are two complementary configuration settings to ``prebind``.
  59. They are :ref:`keepalive` and `prebind_url`_.
  60. ``keepalive`` can be used keep the session alive without having to pass in
  61. new RID and SID tokens to ``converse.initialize`` every time you reload the page.
  62. This removes the need to set up a new BOSH session every time a page loads.
  63. You do however still need to supply the user's JID so that Converse can be
  64. sure that the session it's resuming is for the right user.
  65. `prebind_url`_ lets you specify a URL which Converse will call whenever a
  66. new BOSH session needs to be set up.
  67. Here's an example of Converse being initialized with these three options:
  68. .. code-block:: javascript
  69. converse.initialize({
  70. bosh_service_url: 'https://bind.example.com',
  71. keepalive: true,
  72. jid: 'me@example.com',
  73. authentication: 'prebind',
  74. prebind_url: 'http://example.com/api/prebind',
  75. allow_logout: false
  76. });
  77. allow_bookmarks
  78. ---------------
  79. * Default: ``true``
  80. Enables/disables chatroom bookmarks functionality.
  81. This setting is only applicable if the ``converse-bookmarks`` plugin is loaded.
  82. See also: `allow_public_bookmarks`_
  83. allow_chat_pending_contacts
  84. ---------------------------
  85. * Default: ``false``
  86. Allow the user to chat with pending contacts.
  87. allow_contact_removal
  88. ---------------------
  89. * Default: ``true``
  90. Allow the user to remove roster contacts by clicking on the delete icon
  91. (i.e. trashcan) next to a contact's name in the roster.
  92. allow_contact_requests
  93. ----------------------
  94. * Default: ``true``
  95. Allow users to add one another as contacts. If this is set to false, the
  96. **Add a contact** widget, **Contact Requests** and **Pending Contacts** roster
  97. sections will all not appear. Additionally, all incoming contact requests will be
  98. ignored.
  99. allow_dragresize
  100. ----------------
  101. * Default: ``true``
  102. Allow users to resize chats by dragging the edges. The min-height and min-width
  103. CSS properties set on a chatboxes (specifically on the ``#converse.js .chatbox > .box-flyout`` element)
  104. will be honored, IF they are set in pixels.
  105. allow_muc
  106. ---------
  107. * Default: ``true``
  108. Allow multi-user chat (muc) in chatrooms. Setting this to ``false`` will remove
  109. the ``Chatrooms`` tab from the control box.
  110. allow_muc_invitations
  111. ---------------------
  112. * Default: ``true``
  113. Allows users to be invited to join MUC chatrooms. An "Invite" widget will
  114. appear in the sidebar of the chatroom where you can type in the JID of a user
  115. to invite into the chatroom.
  116. .. _`allow_non_roster_messaging`:
  117. allow_non_roster_messaging
  118. --------------------------
  119. * Default: ``false``
  120. Determines whether you'll receive messages from users that are not in your
  121. roster. The XMPP specification allows for this (similar to email).
  122. Setting this to `true` increases your chances of receiving spam (when using a
  123. federated server), while setting it to `false` means that people not on your
  124. roster can't contact you unless one (or both) of you subscribe to one another's
  125. presence (i.e. adding as a roster contact).
  126. allow_otr
  127. ---------
  128. * Default: ``true``
  129. Allow Off-the-record encryption of single-user chat messages.
  130. allow_public_bookmarks
  131. ----------------------
  132. * Default: ``false``
  133. Some XMPP servers don't support private PEP/PubSub nodes, as required for
  134. private bookmarks and outlined in `XEP-0223 <https://xmpp.org/extensions/xep-0223.html>`_.
  135. Even though Converse asks for the bookmarks to be kept private (via the
  136. `<publish-options>` XML node), the server simply ignores the privacy settings
  137. and publishes the node contents under the default privacy setting, which makes
  138. the information available to all roster contacts.
  139. If your your XMPP server does not support `XEP-0223`'s ``#publish-options``
  140. feature and you don't mind that your room bookmarks are visible to all
  141. contacts, then you can set this setting to ``true``. Otherwise you won't be
  142. able to have any room bookmarks at all for an account on that XMPP server.
  143. allow_registration
  144. ------------------
  145. * Default: ``true``
  146. Support for `XEP-0077: In band registration <http://xmpp.org/extensions/xep-0077.html>`_
  147. Allow XMPP account registration showing the corresponding UI register form interface.
  148. animate
  149. -------
  150. * Default: ``true``
  151. Show animations, for example when opening and closing chatboxes.
  152. archived_messages_page_size
  153. ---------------------------
  154. * Default: ``50``
  155. See also: `message_archiving`_
  156. This feature applies to `XEP-0313: Message Archive Management (MAM) <https://xmpp.org/extensions/xep-0313.html>`_
  157. and will only take effect if your server supports MAM.
  158. It allows you to specify the maximum amount of archived messages to be returned per query.
  159. When you open a chatbox or room, archived messages will be displayed (if
  160. available) and the amount returned will be no more than the page size.
  161. You will be able to query for even older messages by scrolling upwards in the chatbox or room
  162. (the so-called infinite scrolling pattern).
  163. auto_list_rooms
  164. ---------------
  165. * Default: ``false``
  166. If true, and the XMPP server on which the current user is logged in supports
  167. multi-user chat, then a list of rooms on that server will be fetched.
  168. Not recommended for servers with lots of chatrooms.
  169. For each room on the server a query is made to fetch further details (e.g.
  170. features, number of occupants etc.), so on servers with many rooms this
  171. option will create lots of extra connection traffic.
  172. .. _`auto_login`:
  173. auto_login
  174. ----------
  175. * Default: ``false``
  176. This option can be used to let Converse automatically log the user in as
  177. soon as the page loads.
  178. It should be used either with ``authentication`` set to ``anonymous`` or to ``login``.
  179. If ``authentication`` is set to ``login``, then you will also need to provide a
  180. valid ``jid`` and ``password`` values, either manually by passing them in, or
  181. by the `credentials_url`_ setting. Setting a ``credentials_url`` is preferable
  182. to manually passing in ``jid`` and ``password`` values, because it allows
  183. better reconnection with ``auto_reconnect``. When the connection drops,
  184. Converse will automatically fetch new login credentials from the
  185. ``credentials_url`` and reconnect.
  186. If ``authentication`` is set to ``anonymous``, then you will also need to provide the
  187. server's domain via the `jid`_ setting.
  188. This is a useful setting if you'd like to create a custom login form in your
  189. website. You'll need to write some JavaScript to accept that custom form's
  190. login credentials, then you can pass those credentials (``jid`` and
  191. ``password``) to ``converse.initialize`` to start Converse and log the user
  192. into their XMPP account.
  193. auto_away
  194. ---------
  195. * Default: ``0``
  196. The amount of seconds after which the user's presence status should
  197. automatically become ``away``.
  198. If the user's status is ``extended away``, it won't be changed to ``away``.
  199. If the given value is negative or ``0``, this option is disabled.
  200. auto_xa
  201. -------
  202. * Default: ``0``
  203. The amount of seconds after which the user's presence status should
  204. automatically become ``extended away``.
  205. If the value is negative or ``0``, the function is disabled.
  206. auto_reconnect
  207. --------------
  208. * Default: ``false``
  209. Automatically reconnect to the XMPP server if the connection drops
  210. unexpectedly.
  211. This option works best when you have `authentication` set to `prebind` and have
  212. also specified a `prebind_url` URL, from where Converse can fetch the BOSH
  213. tokens. In this case, Converse will automaticallly reconnect when the
  214. connection drops but also reestablish earlier lost connections (due to
  215. network outages, closing your laptop etc.).
  216. When `authentication` is set to `login`, then this option will only work when
  217. the page hasn't been reloaded yet, because then the user's password has been
  218. wiped from memory. This configuration can however still be useful when using
  219. Converse in desktop apps, for example those based on `CEF <https://bitbucket.org/chromiumembedded/cef>`_
  220. or `electron <http://electron.atom.io/>`_.
  221. auto_subscribe
  222. --------------
  223. * Default: ``false``
  224. If true, the user will automatically subscribe back to any contact requests.
  225. auto_join_on_invite
  226. -------------------
  227. * Default: ``false``
  228. If true, the user will automatically join a chatroom on invite without any confirm.
  229. auto_join_private_chats
  230. -----------------------
  231. * Default: ``[]``
  232. Allows you to provide a list of user JIDs for private (i.e. single) chats that
  233. should automatically be started upon login.
  234. For example::
  235. `['tom@example.org', 'dick@example.org', 'harry@example.org']`
  236. auto_join_rooms
  237. ---------------
  238. * Default: ``[]``
  239. This settings allows you to provide a list of groupchat conversations to be
  240. automatically joined once the user has logged in.
  241. You can either specify a simple list of room JIDs, in which case your nickname
  242. will be taken from your JID, or you can specify a list of maps, where each map
  243. specifies the room's JID and the nickname that should be used.
  244. For example::
  245. `[{'jid': 'room@example.org', 'nick': 'WizardKing69' }]`
  246. blacklisted_plugins
  247. -------------------
  248. * Default: ``[]``
  249. A list of plugin names that are blacklisted and will therefore not be
  250. initialized once ``converse.initialize`` is called, even if the same plugin is
  251. whitelisted.
  252. From Converse 3.0 onwards most of the API is available only to plugins and
  253. all plugins need to be whitelisted first.
  254. The usecase for blacklisting is generally to disable removed core plugins
  255. (which are automatically whitelisted) to prevent other (potentially malicious)
  256. plugins from registering themselves under those names.
  257. The core, and by default whitelisted, plugins are::
  258. converse-bookmarks
  259. converse-chatboxes
  260. converse-chatview
  261. converse-controlbox
  262. converse-core
  263. converse-disco
  264. converse-dragresize
  265. converse-fullscreen
  266. converse-headline
  267. converse-mam
  268. converse-minimize
  269. converse-muc
  270. converse-muc-embedded
  271. converse-notification
  272. converse-otr
  273. converse-ping
  274. converse-profile
  275. converse-register
  276. converse-roomslist
  277. converse-rosterview
  278. converse-singleton
  279. converse-spoilers
  280. converse-vcard'
  281. Example:
  282. .. code-block:: javascript
  283. require(['converse-core', 'converse-muc-embedded'], function (converse) {
  284. converse.initialize({
  285. // other settings removed for brevity
  286. blacklisted_plugins: [
  287. 'converse-dragresize',
  288. 'converse-minimize'
  289. ],
  290. });
  291. });
  292. .. _`bosh-service-url`:
  293. bosh_service_url
  294. ----------------
  295. * Default: ``undefined``
  296. To connect to an XMPP server over HTTP you need a `BOSH <https://en.wikipedia.org/wiki/BOSH>`_
  297. connection manager which acts as a middle man between the HTTP and XMPP
  298. protocols.
  299. The bosh_service_url setting takes the URL of a BOSH connection manager.
  300. Please refer to your XMPP server's documentation on how to enable BOSH.
  301. For more information, read this blog post: `Which BOSH server do you need? <http://metajack.im/2008/09/08/which-bosh-server-do-you-need>`_
  302. A more modern alternative to BOSH is to use `websockets <https://developer.mozilla.org/en/docs/WebSockets>`_.
  303. Please see the :ref:`websocket-url` configuration setting.
  304. cache_otr_key
  305. -------------
  306. * Default: ``false``
  307. Let the `OTR (Off-the-record encryption) <https://otr.cypherpunks.ca>`_ private
  308. key be cached in your browser's session storage.
  309. The browser's session storage persists across page loads but is deleted once
  310. the tab or window is closed.
  311. If this option is set to ``false``, a new OTR private key will be generated
  312. for each page load. While more inconvenient, this is a much more secure option.
  313. This setting can only be used together with ``allow_otr = true``.
  314. .. note::
  315. A browser window's session storage is accessible by all javascript that
  316. is served from the same domain. So if there is malicious javascript served by
  317. the same server (or somehow injected via an attacker), then they will be able
  318. to retrieve your private key and read your all the chat messages in your
  319. current session. Previous sessions however cannot be decrypted.
  320. chatstate_notification_blacklist
  321. --------------------------------
  322. * Default: ``[]``
  323. A list of JIDs to be ignored when showing desktop notifications of changed chat states.
  324. Some user's clients routinely connect and disconnect (likely on mobile) and
  325. each time a chat state notificaion is received (``online`` when connecting and
  326. then ``offline`` when disconnecting).
  327. When desktop notifications are turned on (see `show-desktop-notifications`_),
  328. then you'll receive notification messages each time this happens.
  329. Receiving constant notifications that a user's client is connecting and disconnecting
  330. is annoying, so this option allows you to ignore those JIDs.
  331. connection_options
  332. ------------------
  333. * Default: ``{}``
  334. * Type: Object
  335. Converse relies on `Strophe.js <http://strophe.im>`_ to establish and
  336. maintain a connection to the XMPP server.
  337. This option allows you to pass a map of configuration options to be passed into
  338. the ``Strophe.Connection`` constructor.
  339. For documentation on the configuration options that ``Strophe.Connection``
  340. accepts, refer to the
  341. `Strophe.Connection documentation <http://strophe.im/strophejs/doc/1.2.8/files/strophe-js.html#Strophe.Connection.Strophe.Connection>`_.
  342. As an example, suppose you want to restrict the supported SASL authentication
  343. mechanisms, then you'd pass in the ``mechanisms`` as a ``connection_options``
  344. ``key:value`` pair:
  345. .. code-block:: javascript
  346. converse.initialize({
  347. connection_options: {
  348. 'mechanisms': [
  349. converse.env.Strophe.SASLMD5,
  350. ]
  351. },
  352. });
  353. .. _`credentials_url`:
  354. credentials_url
  355. ---------------
  356. * Default: ``null``
  357. * Type: URL
  358. This setting should be used in conjunction with ``authentication`` set to ``login`` and :ref:`keepalive` set to ``true``.
  359. It allows you to specify a URL which Converse will call when it needs to get
  360. the username and password (or authentication token) which Converse will use
  361. to automatically log the user in.
  362. If ``auto_reconnect`` is also set to true, then Converse will automatically
  363. fetch new credentials from the ``credentials_url`` whenever the connection or
  364. session drops, and then attempt to reconnect and establish a new session.
  365. The server behind ``credentials_url`` should return a JSON encoded object::
  366. {
  367. "jid": "me@example.com/resource",
  368. "password": "Ilikecats!",
  369. }
  370. csi_waiting_time
  371. ----------------
  372. * Default: ``0``
  373. This option adds support for `XEP-0352 Client State Indication <http://xmpp.org/extensions/xep-0352.html>_`
  374. If Converse is idle for the configured amount of seconds, a chat state
  375. indication of ``inactive`` will be sent out to the XMPP server (if the server
  376. supports CSI).
  377. Afterwards, ss soon as there is any activity (for example, the mouse moves),
  378. a chat state indication of ``active`` will be sent out.
  379. A value of ``0`` means that this feature is disabled.
  380. debug
  381. -----
  382. * Default: ``false``
  383. If set to true, debugging output will be logged to the browser console.
  384. default_domain
  385. --------------
  386. * Default: ``undefined``
  387. Specify a domain to act as the default for user JIDs. This allows users to log
  388. in with only the username part of their JID, instead of the full JID.
  389. For example, if ``default_domain`` is ``example.org``, then the user
  390. ``johnny@example.org`` can log in with only ``johnny``.
  391. JIDs with other domains are still allowed but need to be provided in full.
  392. To specify only one domain and disallow other domains, see the `locked_domain`_
  393. option.
  394. registration_domain
  395. -------------------
  396. * Default: ``''``
  397. Specify a domain name for which the registration form will be fetched automatically,
  398. without the user having to enter any XMPP server domain name.
  399. default_state
  400. -------------
  401. * Default: ``'online'``
  402. The default chat status that the user wil have. If you for example set this to
  403. ``'chat'``, then Converse will send out a presence stanza with ``"show"``
  404. set to ``'chat'`` as soon as you've been logged in.
  405. domain_placeholder
  406. ------------------
  407. * Default: ``e.g. conversejs.org``
  408. The placeholder text shown in the domain input on the registration form.
  409. emojione_image_path
  410. -------------------
  411. * Default: ``'https://cdn.jsdelivr.net/emojione/assets/' + emojioneVersion + '/png/'``
  412. When `use_emojione`_ is set to ``true``, then this is the URL from where PNG image files for
  413. displaying emojis will be fetched.
  414. expose_rid_and_sid
  415. ------------------
  416. * Default: ``false``
  417. Allow the prebind tokens, RID (request ID) and SID (session ID), to be exposed
  418. globally via the API. This allows other scripts served on the same page to use
  419. these values.
  420. *Beware*: a malicious script could use these tokens to assume your identity
  421. and inject fake chat messages.
  422. filter_by_resource
  423. ------------------
  424. * Default: ``false``
  425. Before version 1.0.3 Converse would ignore received messages if they were
  426. intended for a different resource then the current user had. It was decided to
  427. drop this restriction but leave it configurable.
  428. forward_messages
  429. ----------------
  430. * Default: ``false``
  431. If set to ``true``, sent messages will also be forwarded to the sending user's
  432. bare JID (their Jabber ID independent of any chat clients aka resources).
  433. This means that sent messages are visible from all the user's chat clients,
  434. and not just the one from which it was actually sent.
  435. This is especially important for web chat, such as Converse, where each
  436. browser tab functions as a separate chat client, with its own resource.
  437. This feature uses Stanza forwarding, see also `XEP 0297: Stanza Forwarding <http://www.xmpp.org/extensions/xep-0297.html>`_
  438. For an alternative approach, see also `message_carbons`_.
  439. fullname
  440. --------
  441. If you are using prebinding, can specify the fullname of the currently
  442. logged in user, otherwise the user's vCard will be fetched.
  443. .. _`hide_muc_server`:
  444. geouri_regex
  445. ----------------
  446. * Default: ``/https:\/\/www.openstreetmap.org\/.*#map=[0-9]+\/([\-0-9.]+)\/([\-0-9.]+)\S*/g``
  447. Regular expression used to extract geo coordinates from links to openstreetmap.
  448. geouri_replacement
  449. ------------------
  450. * Default: ``'https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2'``
  451. String used to replace geo-URIs with. Ought to be a link to osm or similar. ``$1`` and ``$2`` is replaced by
  452. latitude and longitude respectively.
  453. hide_muc_server
  454. ---------------
  455. * Default: ``false``
  456. Hide the ``server`` input field of the form inside the ``Room`` panel of the
  457. controlbox. Useful if you want to restrict users to a specific XMPP server of
  458. your choosing.
  459. hide_offline_users
  460. ------------------
  461. * Default: ``false``
  462. If set to ``true``, then don't show offline users.
  463. hide_open_bookmarks
  464. -------------------
  465. * Default: ``false`` (``true`` when the ``view_mode`` is set to ``fullscreen``).
  466. This setting applies to the ``converse-bookmarks`` plugin and specfically the
  467. list of bookmarks shown in the ``Rooms`` tab of the control box.
  468. By default all bookmarks are shown in that list, if this setting is set to
  469. ``true``, then only bookmarks for rooms not currently open (i.e. that the
  470. current user hasn't joined), are shown.
  471. Makes sense to set this to ``true`` when also using the non-core
  472. ``converse-roomslist`` plugin, which shows a list of currently open (i.e.
  473. "joined") rooms.
  474. .. _`i18n`:
  475. i18n
  476. ----
  477. * Default: Auto-detection of the User/Browser language or ``en``;
  478. Specify the locale/language.
  479. The translations for that locale must be available in JSON format at the
  480. `locales_url`_
  481. If an explicit locale is specified via the ``i18n`` setting and the
  482. translations for that locale are not found at the `locales_url``, then
  483. then Converse will fall back to trying to determine the browser's language
  484. and fetching those translations, or if that fails the default English texts
  485. will be used.
  486. jid
  487. ---
  488. The Jabber ID or "JID" of the current user. The JID uniquely identifies a user
  489. on the XMPP network. It looks like an email address, but it's used for instant
  490. messaging instead.
  491. This value needs to be provided when using the :ref:`keepalive` option together
  492. with `prebind`_.
  493. .. _`keepalive`:
  494. keepalive
  495. ---------
  496. * Default: ``true``
  497. Determines whether Converse will maintain the chat session across page
  498. loads.
  499. This setting should also be used in conjunction with ``authentication`` set to `prebind`_.
  500. When using ``keepalive`` and ``prebind``, you will have to provide the `jid`_
  501. of the current user to ensure that a cached session is only resumed if it
  502. belongs to the current user.
  503. See also:
  504. * :ref:`session-support`
  505. .. note::
  506. Currently the "keepalive" setting only works with BOSH and not with
  507. websockets. This is because XMPP over websocket does not use the same
  508. session token as with BOSH. A possible solution for this is to implement
  509. `XEP-0198 <http://xmpp.org/extensions/xep-0198.html>`_, specifically
  510. with regards to "stream resumption".
  511. .. _`locales`:
  512. locales
  513. -------
  514. * Default:
  515. .. code-block:: javascript
  516. locales: [
  517. 'af', 'ca', 'de',
  518. 'es', 'en', 'fr',
  519. 'he', 'hu', 'id',
  520. 'it', 'ja', 'nb',
  521. 'nl', 'pl', 'pt_BR',
  522. 'ru', 'uk', 'zh'
  523. ]
  524. This setting restricts the locales that are supported by Converse and
  525. therefore what may be given as value for the :ref:`i18n` option.
  526. Any other locales will be ignored.
  527. When self-hosting, also make sure that the locales are served and therefore
  528. fetchable (via ``XMLHttpRequest``) at the URL specified by :ref:`locales-url`.
  529. .. _`locales-url`:
  530. locales_url
  531. -----------
  532. * Default: ``/locale/{{{locale}}}/LC_MESSAGES/converse.json``,
  533. The URL from where Converse should fetch translation JSON.
  534. The three curly braces ``{{{ }}}`` are
  535. `Mustache <https://github.com/janl/mustache.js#readme>`_-style
  536. variable interpolation which HTML-escapes the value being inserted. It's
  537. important that the inserted value is HTML-escaped, otherwise a malicious script
  538. injection attack could be attempted.
  539. The variable being interpolated via the curly braces is ``locale``, which is
  540. the value passed in to the `i18n`_ setting, or the browser's locale or the
  541. default local or `en` (resolved in that order).
  542. From version 3.3.0, Converse no longer bundles all translations into its
  543. final build file. Instead, only the relevant translations are fetched at
  544. runtime.
  545. This change also means that it's no longer possible to pass in the translation
  546. JSON data directly into ``_converse.initialize`` via the `i18n`_ setting.
  547. Instead, you only specify the language code (e.g. `de`) and that language's
  548. JSON translations will automatically be fetched via XMLHTTPRequest at
  549. ``locales_url``.
  550. locked_domain
  551. -------------
  552. * Default: ``undefined``
  553. Similar to `default_domain`_ but no other domains are allowed.
  554. For example, if ``locked_domain`` is set to ``example.org``, then the user
  555. ``johnny@example.org`` can log in with only ``johnny``.
  556. Additionally, only users registered on the ``example.org`` host can log in, no
  557. other users are allowed to log in.
  558. message_archiving
  559. -----------------
  560. * Default: ``undefined``
  561. Provides support for `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
  562. whereby messages are archived in the XMPP server for later retrieval.
  563. Note, your XMPP server must support XEP-0313 MAM for this to work.
  564. This option sets the default archiving preference.
  565. Valid values are ``undefined``, ``never``, ``always`` and ``roster``.
  566. ``undefined`` means that any existing MAM configuration, as set by the user or
  567. the server administrator, will be used.
  568. ``roster`` means that only messages to and from JIDs in your roster will be
  569. archived. The other two values are self-explanatory.
  570. message_archiving_timeout
  571. -------------------------
  572. * Default: ``8000``
  573. The amount of time (in milliseconds) to wait when requesting archived messages
  574. from the XMPP server.
  575. Used in conjunction with `message_archiving` and in context of `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_.
  576. message_carbons
  577. ---------------
  578. * Default: ``false``
  579. Support for `XEP-0280: Message Carbons <https://xmpp.org/extensions/xep-0280.html>`_
  580. In order to keep all IM clients for a user engaged in a conversation,
  581. outbound messages are carbon-copied to all interested resources.
  582. This is especially important in webchat, like Converse, where each browser
  583. tab serves as a separate IM client.
  584. Both message_carbons and `forward_messages`_ try to solve the same problem
  585. (showing sent messages in all connected chat clients aka resources), but go about it
  586. in two different ways.
  587. Message carbons is the XEP (Jabber protocol extension) specifically drafted to
  588. solve this problem, while `forward_messages`_ uses
  589. `stanza forwarding <http://www.xmpp.org/extensions/xep-0297.html>`_
  590. muc_disable_moderator_commands
  591. ------------------------------
  592. * Default: ``false``
  593. Allows you to disable the moderator commands such as ``/kick`` or ``/ban``.
  594. muc_domain
  595. ----------
  596. * Default: ``undefined``
  597. The MUC (multi-user chat) domain that should be used. By default Converse
  598. will attempt to get the MUC domain from the XMPP host of the currently logged in
  599. user.
  600. This setting will override that. You might want to combine this setting with `hide_muc_server`_.
  601. muc_history_max_stanzas
  602. -----------------------
  603. * Default: ``undefined``
  604. This option allows you to specify the maximum amount of messages to be shown in a
  605. chatroom when you enter it. By default, the amount specified in the room
  606. configuration or determined by the server will be returned.
  607. Please note, this option is not related to
  608. `XEP-0313 Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
  609. which also allows you to show archived chatroom messages, but follows a
  610. different approach.
  611. If you're using MAM for archiving chatroom messages, you might want to set
  612. this option to zero.
  613. muc_instant_rooms
  614. ------------------
  615. * Default: ``true``
  616. Determines whether 'instant' (also called 'dynamic' in OpenFire) rooms are created.
  617. Otherwise rooms first have to be configured before they're available to other
  618. users (so-called "registered rooms" in `MUC-0045 <http://xmpp.org/extensions/xep-0045.html#createroom>`_).
  619. From a UX perspective, if this settings is `false`, then a configuration form will
  620. render, that has to be filled in first, before the room can be joined by other
  621. users.
  622. muc_nickname_from_jid
  623. ---------------------
  624. * Default: ``false``
  625. When set to ``true``, then users will not be prompted to provide nicknames for
  626. chatrooms. Instead, the node part of a user's JID (i.e. JID = node@domain/resource)
  627. will be used. If the user's nickname is already taken by another user in the
  628. chatroom, then an integer will be added to make it unique.
  629. So, for example, if john@example.com joins a chatroom, his nickname will
  630. automatically be "john". If now john@differentdomain.com tries to join the
  631. room, his nickname will be "john-2", and if john@somethingelse.com joins, then
  632. his nickname will be "john-3", and so forth.
  633. muc_show_join_leave
  634. -------------------
  635. * Default; ``true``
  636. Determines whether Converse will show info messages inside a chatroom
  637. whenever a user joins or leaves it.
  638. nickname
  639. --------
  640. * Default: ``undefined``
  641. This setting allows you to specify the nickname for the current user.
  642. The nickname will be included in presence requests to other users and will also
  643. be used as the default nickname when entering MUC chatrooms.
  644. notify_all_room_messages
  645. ------------------------
  646. * Default: ``false``
  647. By default, sound and desktop notifications will only be made when you are
  648. mentioned in a room. If you set this setting to `true`, then you will be
  649. notified of all messages received in a room.
  650. You can also pass an array of room JIDs to this option, to only apply it to
  651. certain rooms.
  652. notification_icon
  653. -----------------
  654. * Default: ``'/logo/conversejs.png'``
  655. This option specifies which icon is shown in HTML5 notifications, as provided
  656. by the ``src/converse-notification.js`` plugin.
  657. oauth_providers
  658. ---------------
  659. * Default: ``[]``
  660. Allows you to specify a list of OAuth providers that the user may use to log in
  661. with.
  662. .. note::
  663. Your XMPP server will have to support Oauth logins
  664. .. code-block:: javascript
  665. converse.initialize({
  666. oauth_providers: {
  667. 'github': {
  668. 'client_id': '1338d9f7ff52b1309b29',
  669. 'host': 'chat.example.org',
  670. 'class': 'fa-github-alt',
  671. 'id': 'github',
  672. 'name': 'Github'
  673. },
  674. 'twitter': {
  675. 'client_id': '0332d98cff83b1999b22',
  676. 'host': 'chat.example.org',
  677. 'class': 'fa-twitter',
  678. 'id': 'twitter',
  679. 'name': 'Twitter'
  680. }
  681. },
  682. });
  683. ping_interval
  684. -------------
  685. * Default: ``180``
  686. Make ping to server in order to keep connection with server killing sessions after idle timeout.
  687. The ping are sent only if no messages are sent in the last ``ping_interval`` seconds
  688. You need to set the value to any positive value to enable this functionality.
  689. If you set this value to ``0`` or any negative value, il will disable this functionality.
  690. .. _`play-sounds`:
  691. play_sounds
  692. -----------
  693. * Default: ``false``
  694. Plays a notification sound when you receive a personal message or when your
  695. nickname is mentioned in a chatroom.
  696. Inside the ``./sounds`` directory of the Converse repo you'll see MP3 and Ogg
  697. formatted sound files. We need both, because neither format is supported by all browsers.
  698. You can set the URL where the sound files are hosted with the `sounds_path`_
  699. option.
  700. Requires the `src/converse-notification.js` plugin.
  701. .. _`prebind_url`:
  702. prebind_url
  703. -----------
  704. * Default: ``null``
  705. * Type: URL
  706. See also: :ref:`session-support`
  707. This setting should be used in conjunction with ``authentication`` set to `prebind` and :ref:`keepalive` set to ``true``.
  708. It allows you to specify a URL which Converse will call when it needs to get
  709. the RID and SID (Request ID and Session ID) tokens of a BOSH connection, which
  710. Converse will then attach to.
  711. The server behind ``prebind_url`` should return a JSON encoded object with the
  712. three tokens::
  713. {
  714. "jid": "me@example.com/resource",
  715. "sid": "346234623462",
  716. "rid": "876987608760"
  717. }
  718. priority
  719. --------
  720. * Default: ``0``
  721. * Type: Number
  722. Determines the priority used for presence stanzas sent out from this resource
  723. (i.e. this instance of Converse).
  724. The priority of a given XMPP chat client determines the importance of its presence
  725. stanzas in relation to stanzas received from other clients of the same user.
  726. In Converse, the indicated chat status of a roster contact will be taken from the
  727. presence stanza (and associated resource) with the highest priority.
  728. If multiple resources have the same top priority, then the chat status will be
  729. taken from the most recent present stanza.
  730. For more info you can read `Section 2.2.2.3 of RFC-3921 <https://xmpp.org/rfcs/rfc3921.html#rfc.section.2.2.2.3>`_.
  731. providers_link
  732. --------------
  733. * Default: ``https://xmpp.net/directory.php``
  734. The hyperlink on the registration form which points to a directory of public
  735. XMPP servers.
  736. push_app_servers
  737. ----------------
  738. * Default: ``[]``
  739. This option lets you enable or disable so-called push notification "App Servers"
  740. (as per `XEP-0357 <https://xmpp.org/extensions/xep-0357.html>`_).
  741. For each "App Server" an object needs to be passed in. When enabling, you need
  742. to specify ``jid`` and ``node`` values. You can also provide a
  743. ``secret``, if required by your App Server.
  744. When disabling, you need to specify at least a ``jid`` and set ``disabled`` to
  745. ``true``. This will disable notifications to all pubsub nodes on that "App
  746. Server". If you want to disable only a particular node, then specify a ``node``
  747. value as well.
  748. For example:
  749. .. code-block:: javascript
  750. converse.initialize({
  751. 'push_app_servers': [{
  752. 'jid': 'push-4@client.example',
  753. 'node': 'yxs32uqsflafdk3iuqo',
  754. 'disable': true
  755. }, {
  756. 'jid': 'push-5@client.example',
  757. 'node': 'yxs32uqsflafdk3iuqo',
  758. }]
  759. });
  760. root
  761. ----
  762. * Default: ``window.document``
  763. When using Converse inside a web component's shadow DOM, you will need to set this settings'
  764. value to the shadow-root of the shadow DOM.
  765. For example:
  766. .. code-block:: javascript
  767. class CustomChatComponent extends HTMLElement {
  768. constructor() {
  769. super();
  770. const shadowRoot = this.attachShadow({mode: "open"});
  771. this.initConverse(shadowRoot);
  772. }
  773. initConverse(shadowRoot) {
  774. window.addEventListener("converse-loaded", function(event) {
  775. converse.initialize({
  776. root: shadowRoot,
  777. // Other settings go here...
  778. });
  779. });
  780. }
  781. }
  782. roster_groups
  783. -------------
  784. * Default: ``false``
  785. If set to ``true``, Converse will show any roster groups you might have
  786. configured.
  787. .. note::
  788. It's currently not possible to use Converse to assign contacts to groups.
  789. Converse can only show users and groups that were previously configured
  790. elsewhere.
  791. show_chatstate_notifications
  792. ----------------------------
  793. * Default: ``false``
  794. Specifies whether chat state (online, dnd, away) HTML5 desktop notifications should be shown.
  795. show_controlbox_by_default
  796. --------------------------
  797. * Default: ``false`` (``true`` when the ``view_mode`` is set to ``fullscreen``)
  798. The "controlbox" refers to the special chatbox containing your contacts roster,
  799. status widget, chatrooms and other controls.
  800. By default this box is hidden and can be toggled by clicking on any element in
  801. the page with class *toggle-controlbox*.
  802. If this options is set to true, the controlbox will by default be shown upon
  803. page load.
  804. However, be aware that even if this value is set to ``false``, if the
  805. controlbox is open, and the page is reloaded, then it will stay open on the new
  806. page as well.
  807. .. _`show-desktop-notifications`:
  808. show_desktop_notifications
  809. --------------------------
  810. * Default: ``true``
  811. Should HTML5 desktop notifications be shown?
  812. Notification will be shown in the following cases:
  813. * the browser is not visible nor focused and a private message is received.
  814. * the browser is not visible nor focused and a groupchat message is received which mentions you.
  815. * `auto_subscribe` is set to `false` and a new contact request is received.
  816. Requires the `src/converse-notification.js` plugin.
  817. use_emojione
  818. ------------
  819. * Default: ``true``
  820. Determines whether `Emojione <https://www.emojione.com/>`_ should be used to
  821. render emojis. If set to ``false``, then rendering support will fall back to
  822. the operating system or browser (which might not support emoji).
  823. See also `emojione_image_path`_.
  824. show_only_online_users
  825. ----------------------
  826. * Default: ``false``
  827. If set to ``true``, only online users will be shown in the contacts roster.
  828. Users with any other status (e.g. away, busy etc.) will not be shown.
  829. show_send_button
  830. ----------------------
  831. * Default: ``false``
  832. If set to ``true``, a button will be visible which can be clicked to send a message.
  833. sounds_path
  834. -----------
  835. * Default: ``/sounds/``
  836. This option only makes sense in conjunction with the `play_sounds`_ option and
  837. specifies the URL of the sound files to be played (exluding the file names
  838. themselves).
  839. In order to support all browsers we need both an MP3 and an Ogg file. Make sure
  840. to name your files ``msg_received.ogg`` and ``msg_received.mp3``.
  841. sticky_controlbox
  842. -----------------
  843. * Default: ``false`` (``true`` when the ``view_mode`` is set to ``fullscreen``).
  844. If set to ``true``, the control box (which includes the login, registration,
  845. contacts and rooms tabs) will not be closeable. It won't have a close button at
  846. all.
  847. The idea behind this setting is to provide a better experience on mobile
  848. devices when the intent is to use Converse as a web app. In this case
  849. it doesn't make sense to close the control box, as there's often then nothing
  850. "behind" it that's relevant to the user.
  851. .. _`strict_plugin_dependencies`:
  852. strict_plugin_dependencies
  853. --------------------------
  854. * Default: ``false``
  855. When set to ``true`` and a plugin tries to override an object which doesn't
  856. exist (for example because the plugin which provides that object is not
  857. loaded), then an error will be raised.
  858. Otherwise a message will simply be logged and the override instruction ignored.
  859. The Converse plugins architecture can have an :ref:`dependencies`
  860. plugin attribute. This enables you to specify an array of other plugins which
  861. this one depends on.
  862. Converse (more specifically, `pluggable.js <https://jcbrand.github.io/pluggable.js/>`_)
  863. will first load these dependencies before executing the plugin's overrides and
  864. calling its ``initialize`` method.
  865. This is especially important if you register event handlers in your plugin for
  866. events that fire in other plugins. In this case, you want to specify those
  867. other plugins as dependencies.
  868. If ``strict_plugin_dependencies`` is set to ``false``, an error won't be raised
  869. if the optional dependencies aren't found.
  870. synchronize_availability
  871. ------------------------
  872. * Default: ``true``
  873. Valid options: ``true``, ``false``, ``a resource name``.
  874. This option lets you synchronize your chat status (`online`, `busy`, `away`) with other chat clients. In other words,
  875. if you change your status to `busy` in a different chat client, your status will change to `busy` in Converse as well.
  876. If set to ``true``, Converse will synchronize with all other clients you are logged in with.
  877. If set to ``false``, this feature is disabled.
  878. If set to ``a resource name``, Converse will synchronize only with a client that has that particular resource assigned to it.
  879. trusted
  880. -------
  881. * Default: ``true``
  882. This setting determines whether the default value of the "This is a trusted device"
  883. checkbox in the login form.
  884. When the current device is not trusted, then the cache will be cleared when
  885. the user logs out.
  886. Additionally, it determines the type of `browser storage <https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage>`_
  887. (``localStorage`` or ``sessionStorage``) used by Converse to cache user data.
  888. If ``trusted`` is set to ``false``, then ``sessionStorage`` is used instead of
  889. ``localStorage``.
  890. The main difference between the two is that ``sessionStorage`` only persists while
  891. the current tab or window containing a Converse instance is open. As soon as
  892. it's closed, the data is cleared (as long as there aren't any other tabs with
  893. the same domain open).
  894. Data in ``localStorage`` on the other hand is kept indefinitely.
  895. The data that is cached includes your sent and received messages, which chats you had
  896. open, what features the XMPP server supports and what your online status was.
  897. Clearing the cache makes Converse much slower when the user logs
  898. in again, because all data needs to be fetch anew.
  899. time_format
  900. -----------
  901. * Default: ``HH:mm``
  902. Examples: ``HH:mm``, ``hh:mm``, ``hh:mm a``.
  903. This option makes the time format for the time shown, for each message, configurable. Converse uses `moment.js <https://momentjs.com/>`_
  904. for showing time. This option allows the configuration of the format in which `moment` will display the time for the messages. For detailed
  905. description of time-format options available for `moment` you can check this `link <https://momentjs.com/docs/#/parsing/string-format/>`_.
  906. use_otr_by_default
  907. ------------------
  908. * Default: ``false``
  909. If set to ``true``, Converse will automatically try to initiate an OTR (off-the-record)
  910. encrypted chat session every time you open a chatbox.
  911. visible_toolbar_buttons
  912. -----------------------
  913. * Default:
  914. .. code-block:: javascript
  915. {
  916. call: false,
  917. emoji: true,
  918. toggle_occupants: true
  919. }
  920. Allows you to show or hide buttons on the chatboxes' toolbars.
  921. * *call*:
  922. Provides a button with a picture of a telephone on it.
  923. When the call button is pressed, it will emit an event that can be used by a third-party library to initiate a call.
  924. .. code-block:: javascript
  925. converse.listen.on('callButtonClicked', function(data) {
  926. console.log('Strophe connection is', data.connection);
  927. console.log('Bare buddy JID is', data.model.get('jid'));
  928. // ... Third-party library code ...
  929. });
  930. * *emoji*:
  931. Enables rendering of emoji and provides a toolbar button for choosing them.
  932. * *toggle_occupants*:
  933. Shows a button for toggling (i.e. showing/hiding) the list of occupants in a chatroom.
  934. .. _`websocket-url`:
  935. websocket_url
  936. -------------
  937. * Default: ``undefined``
  938. This option is used to specify a
  939. `websocket <https://developer.mozilla.org/en/docs/WebSockets>`_ URI to which
  940. Converse can connect to.
  941. Websockets provide a more modern and effective two-way communication protocol
  942. between the browser and a server, effectively emulating TCP at the application
  943. layer and therefore overcoming many of the problems with existing long-polling
  944. techniques for bidirectional HTTP (such as `BOSH <https://en.wikipedia.org/wiki/BOSH>`_).
  945. Please refer to your XMPP server's documentation on how to enable websocket
  946. support.
  947. .. note::
  948. Please note that not older browsers do not support websockets. For older
  949. browsers you'll want to specify a BOSH URL. See the :ref:`bosh-service-url`
  950. configuration setting).
  951. .. note::
  952. Converse does not yet support "keepalive" with websockets.
  953. .. _`view_mode`:
  954. view_mode
  955. ---------
  956. * Default: ``overlayed``
  957. * Allowed values: ``overlayed``, ``fullscreen``, ``mobile``, ``embedded``
  958. The ``view_mode`` setting configures Converse's mode and resulting behavior.
  959. Before the introduction of this setting (in version 3.3.0), there were there
  960. different builds, each for the different modes.
  961. These were:
  962. * ``converse-mobile.js`` for the ``mobile`` mode
  963. * ``converse-muc-embedded.js`` for embedding a single MUC room into a DOM element with id ``conversejs``
  964. * ``converse.js`` for the ``overlayed`` mode
  965. * ``inverse.js`` for the ``fullscreen`` mode
  966. Besides having different builds, certain plugins had to be whitelisted
  967. and blacklisted for the different modes.
  968. ``converse-singleton`` had to be whitelisted for the ``mobile`` and ``fullscreen``
  969. modes, additionally ``converse-inverse`` had to be whitelisted for the
  970. ``fullscreen`` mode.
  971. For both those modes the ``converse-minimize`` and ``converse-dragresize``
  972. plugins had to be blacklisted.
  973. When using ``converse-muc-embedded.js`` various plugins also had to manually be
  974. blacklisted.
  975. Since version 3.3.0 it's no longer necessary to blacklist any plugins (except
  976. for ``converse-muc-embedded.js``, which is from version 3.3.3).
  977. Blacklisting now happens automatically.
  978. Since version 3.3.0, the ``inverse.js`` and ``converse-mobile.js`` builds no
  979. longer exist. Instead the standard ``converse.js`` build is used, together with
  980. the appropriate ``view_mode`` value.
  981. Since verseion 4.0.0, there is now also only one CSS file to be used for all
  982. the different view modes, ``converse.css``.
  983. The ``converse-muc-embedded.js`` build is still kept, because it's smaller than
  984. ``converse.js`` due to unused code being removed. It doesn't however contain
  985. any new code, so the full ``converse.js`` build could be used instead, as long
  986. as ``view_mode`` is set to ``embedded``.
  987. Furthermore, it's no longer necessary to whitelist or blacklist any plugins
  988. when switching view modes.
  989. .. _`whitelisted_plugins`:
  990. whitelisted_plugins
  991. -------------------
  992. * Default: ``[]``
  993. A list of plugin names that are whitelisted and will therefore be
  994. initialized once ``converse.initialize`` is called.
  995. From Converse 3.0 onwards most of the API is available only to plugins and
  996. all plugins need to be whitelisted first.
  997. This is done to prevent malicious scripts from using the API to trick users or
  998. to read their conversations.
  999. By default all the core plugins are already whitelisted.
  1000. These are::
  1001. converse-bookmarks
  1002. converse-chatboxes
  1003. converse-chatview
  1004. converse-controlbox
  1005. converse-core
  1006. converse-disco
  1007. converse-dragresize
  1008. converse-fullscreen
  1009. converse-headline
  1010. converse-mam
  1011. converse-minimize
  1012. converse-muc
  1013. converse-muc-embedded
  1014. converse-notification
  1015. converse-otr
  1016. converse-ping
  1017. converse-profile
  1018. converse-register
  1019. converse-roomslist
  1020. converse-rosterview
  1021. converse-singleton
  1022. converse-spoilers
  1023. converse-vcard'
  1024. .. note::
  1025. If you are using a custom build which excludes some core plugins, then you
  1026. should blacklist them so that malicious scripts can't register their own
  1027. plugins under those names. See `blacklisted_plugins`_ for more info.
  1028. Example:
  1029. .. code-block:: javascript
  1030. require(['converse-core', 'converse-muc-embedded'], function (converse) {
  1031. converse.initialize({
  1032. // other settings removed for brevity
  1033. whitelisted_plugins: ['myplugin']
  1034. });
  1035. });
  1036. xhr_user_search_url
  1037. -------------------
  1038. .. note::
  1039. XHR stands for XMLHTTPRequest, and is meant here in the AJAX sense (Asynchronous JavaScript and XML).
  1040. * Default: ``null``
  1041. There are two ways to add users.
  1042. * The user inputs a valid JID (Jabber ID, aka XMPP address), and the user is added as a pending contact.
  1043. * The user inputs some text (for example part of a first name or last name),
  1044. an XHR (Ajax Request) will be made to a remote server, and a list of matches are returned.
  1045. The user can then choose one of the matches to add as a contact.
  1046. By providing an XHR search URL, you're enabling the second mechanism.
  1047. *What is expected from the remote server?*
  1048. A default JSON encoded list of objects must be returned. Each object
  1049. corresponds to a matched user and needs the keys ``jid`` and ``fullname``.
  1050. .. code-block:: javascript
  1051. [{"jid": "marty@mcfly.net", "fullname": "Marty McFly"}, {"jid": "doc@brown.com", "fullname": "Doc Brown"}]
  1052. .. note::
  1053. Make sure your server script sets the header `Content-Type: application/json`.
  1054. This is the URL to which an XHR GET request will be made to fetch user data from your remote server.
  1055. The query string will be included in the request with ``q`` as its key.
  1056. The data returned must be a JSON encoded list of user JIDs.
  1057. .. note::
  1058. Converse will construct the XHR get URL by simply appending
  1059. ``q=<query string entered>`` to the URL given by ``xhr_user_search_url``.
  1060. It is therefore important that the necessary question mark (``?``) preceding the
  1061. URL's query component or necessary delimiters (``&``) are included. See valid
  1062. examples below.
  1063. Examples:
  1064. .. code-block:: javascript
  1065. xhr_user_search_url: 'https://some.url/some_path?',
  1066. xhr_user_search_url: 'https://some.url/some_path?api_key=somekey&',