configuration.rst 53 KB

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