configuration.rst 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447
  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. .. _`configuration-settings`:
  15. Configuration settings
  16. ======================
  17. .. _`allowed_audio_domains`:
  18. allowed_audio_domains
  19. ---------------------
  20. * Default: ``null``
  21. If falsy, all domains are allowed. Set it to an array to specify a whitelist of allowed domains.
  22. .. _`allowed_image_domains`:
  23. allowed_image_domains
  24. ---------------------
  25. * Default: ``null``
  26. If falsy, all domains are allowed. Set it to an array to specify a whitelist of allowed domains.
  27. E.g. ``['imgur.com', 'imgbb.com']``
  28. .. _`allowed_video_domains`:
  29. allowed_video_domains
  30. ---------------------
  31. * Default: ``null``
  32. If falsy, all domains are allowed. Set it to an array to specify a whitelist of allowed domains.
  33. E.g. ``['imgur.com']``
  34. authentication
  35. --------------
  36. * Default: ``login``
  37. * Allowed values: `login`_, `external`, `anonymous`_, `prebind`_
  38. This option states the way Converse will authenticate.
  39. login
  40. ~~~~~
  41. The default means is ``login``, which means that the user either logs in manually with their
  42. username and password, or automatically if used together with `auto_login`_ set to ``true``
  43. and ``jid`` and ``password`` values.
  44. external
  45. ~~~~~~~~
  46. This setting will still show a login form and submit button, but the form will
  47. only contain an input for the user's JID, *not* for the password.
  48. That's because this setting is intended to be used when you are using
  49. SASL-EXTERNAL as authentication mechanism, in which case a password is usually
  50. not required.
  51. SASL-EXTERNAL is generally used together with x509 client certificates to
  52. enable passwordless login or 2-factor authentication.
  53. For more details on this, `read this blog post <https://opkode.com/blog/strophe_converse_sasl_external/>`_.
  54. anonymous
  55. ~~~~~~~~~
  56. This enables anonymous login if the XMPP server supports it. This option can be
  57. used together with `auto_login`_ to automatically and anonymously log a user in
  58. as soon as the page loads.
  59. The server's domain is passed in via the `jid`_ setting.
  60. .. _`prebind`:
  61. prebind
  62. ~~~~~~~
  63. See also: :ref:`session-support`
  64. Use this option when you want to attach to an existing XMPP
  65. `BOSH <https://en.wikipedia.org/wiki/BOSH>`_ session.
  66. Usually a BOSH session is set up server-side in your web app.
  67. Attaching to an existing BOSH session that was set up server-side is useful
  68. when you want to maintain a persistent single session for your users instead of
  69. requiring them to log in manually.
  70. When a BOSH session is initially created, you'll receive three tokens.
  71. A JID (jabber ID), SID (session ID) and RID (Request ID).
  72. Converse needs these tokens in order to attach to that same session.
  73. In addition to setting `authentication`_ to ``prebind``, you'll also need to
  74. set the `prebind_url`_ and `bosh-service-url`_.
  75. Here's an example of Converse being initialized with these options:
  76. .. code-block:: javascript
  77. converse.initialize({
  78. bosh_service_url: 'https://bind.example.com',
  79. jid: 'me@example.com',
  80. authentication: 'prebind',
  81. prebind_url: 'http://example.com/api/prebind',
  82. auto_login: true,
  83. allow_logout: false
  84. });
  85. allow_adhoc_commands
  86. --------------------
  87. * Default: ``true``
  88. Allows privileged users to run XEP-0050 Ad-Hoc commands via the settings modal.
  89. allow_bookmarks
  90. ---------------
  91. * Default: ``true``
  92. Enables/disables chatroom bookmarks functionality.
  93. This setting is only applicable if the ``converse-bookmarks`` plugin is loaded.
  94. See also: `allow_public_bookmarks`_
  95. allow_contact_removal
  96. ---------------------
  97. * Default: ``true``
  98. Allow the user to remove roster contacts by clicking on the delete icon
  99. (i.e. trashcan) next to a contact's name in the roster.
  100. allow_contact_requests
  101. ----------------------
  102. * Default: ``true``
  103. Allow users to add one another as contacts. If this is set to false, the
  104. **Add a contact** widget, **Contact Requests** and **Pending Contacts** roster
  105. sections will all not appear. Additionally, all incoming contact requests will be
  106. ignored.
  107. allow_dragresize
  108. ----------------
  109. * Default: ``true``
  110. Allow users to resize chats by dragging the edges. The min-height and min-width
  111. CSS properties set on a chatboxes (specifically on the ``.chatbox > .box-flyout`` element)
  112. will be honored, IF they are set in pixels.
  113. allow_logout
  114. ------------
  115. * Default: ``true``
  116. Determines whether the user is allowed to log out. If set to ``false``, there will be no logout button.
  117. .. _`allow_message_corrections`:
  118. allow_message_corrections
  119. -------------------------
  120. * Default: ``'all'``
  121. * Possible values: ``'all'``, ``'last'``
  122. Configures the last message correction (LMC) feature of Converse. By default you can edit all of your own
  123. messages. Setting this to ``'last'`` will limit this feature to the message sent most recently as suggested by
  124. `XEP-0308: Last Message Correction <https://xmpp.org/extensions/xep-0308.html>`_.
  125. Setting it to anything else (including ``false``) will disable the ability to correct sent messages.
  126. allow_message_retraction
  127. ------------------------
  128. * Default: ``'all'``
  129. * Possible values: ``'all'``, ``'own'``, ``'moderator'`` or any falsy value
  130. Determines who is allowed to retract messages. If set to ``'all'``, then normal
  131. users may retract their own messages and ``'moderators'`` may retract the messages of
  132. other users.
  133. allow_message_styling
  134. ---------------------
  135. * Default: ``true``
  136. * Possible values: ``true``, ``false``
  137. Determines wehether support for XEP-0393 Message Styling hints are enabled or not.
  138. allow_muc_invitations
  139. ---------------------
  140. * Default: ``true``
  141. Allows users to be invited to join MUC chatrooms. An "Invite" widget will
  142. appear in the sidebar of the chatroom where you can type in the JID of a user
  143. to invite into the chatroom.
  144. .. _`allow_non_roster_messaging`:
  145. allow_non_roster_messaging
  146. --------------------------
  147. * Default: ``false``
  148. Determines whether you'll receive messages from users that are not in your
  149. roster. The XMPP specification allows for this (similar to email).
  150. Setting this to ``true`` increases your chances of receiving spam (when using a
  151. federated server), while setting it to ``false`` means that people not on your
  152. roster can't contact you unless one (or both) of you subscribe to one another's
  153. presence (i.e. adding as a roster contact).
  154. allow_public_bookmarks
  155. ----------------------
  156. * Default: ``false``
  157. Some XMPP servers don't support private PEP/PubSub nodes, as required for
  158. private bookmarks and outlined in `XEP-0223 <https://xmpp.org/extensions/xep-0223.html>`_.
  159. Even though Converse asks for the bookmarks to be kept private (via the
  160. `<publish-options>` XML node), the server simply ignores the privacy settings
  161. and publishes the node contents under the default privacy setting, which makes
  162. the information available to all roster contacts.
  163. If your XMPP server does not support `XEP-0223`'s ``#publish-options``
  164. feature and you don't mind that your room bookmarks are visible to all
  165. contacts, then you can set this setting to ``true``. Otherwise you won't be
  166. able to have any room bookmarks at all for an account on that XMPP server.
  167. allow_registration
  168. ------------------
  169. * Default: ``true``
  170. Support for `XEP-0077: In band registration <https://xmpp.org/extensions/xep-0077.html>`_
  171. Allow XMPP account registration showing the corresponding UI register form interface.
  172. allow_url_history_change
  173. ------------------------
  174. * Default: ``true``
  175. Allow Converse to change the browser url bar through the History API <https://developer.mozilla.org/en-US/docs/Web/API/History_API>.
  176. allow_user_trust_override
  177. -------------------------
  178. * Default: ``true``
  179. * Allowed values: ``true``, ``false``, ``off``
  180. This setting determines whether a user may decide whether
  181. Converse is ``trusted`` or not (e.g. in the particular browser).
  182. This is done via a *This is a trusted device* checkbox in the login form.
  183. If this setting is set to ``true`` or ``off``, the checkbox will be shown to the user, otherwise not.
  184. When this setting is set to ``true``, the checkbox will be checked by default.
  185. To not have it checked by default, set this setting to ``off``.
  186. If the user indicates that this device/browser is not trusted, then effectively
  187. it's the same as setting `clear_cache_on_logout`_ to ``true``
  188. and `persistent_store`_ to ``sessionStorage``.
  189. ``sessionStorage`` only persists while the current tab or window containing a Converse instance is open.
  190. As soon as it's closed, the data is cleared.
  191. The data that is cached (or cleared) includes your sent and received messages, which chats you had
  192. open, what features the XMPP server supports and what your online status was.
  193. Clearing the cache makes Converse much slower when the user logs in again, because all data needs to be fetch anew.
  194. archived_messages_page_size
  195. ---------------------------
  196. * Default: ``50``
  197. See also: `message_archiving`_
  198. This feature applies to `XEP-0313: Message Archive Management (MAM) <https://xmpp.org/extensions/xep-0313.html>`_
  199. and will only take effect if your server supports MAM.
  200. It allows you to specify the maximum amount of archived messages to be returned per query.
  201. When you open a chatbox or room, archived messages will be displayed (if
  202. available) and the amount returned will be no more than the page size.
  203. You will be able to query for even older messages by scrolling upwards in the chatbox or room
  204. (the so-called infinite scrolling pattern).
  205. autocomplete_add_contact
  206. ------------------------
  207. * Default: ``true``
  208. Determines whether search suggestions are shown in the "Add Contact" modal.
  209. auto_focus
  210. ----------
  211. * Default: ``true``
  212. If set to ``true``, the textarea for composing chat messages will automatically
  213. become focused as soon as a chat is opened. This means you don't need to click
  214. the textarea first before starting to type a message. This also applies to the
  215. username field which is automatically focused after the login controlbox is
  216. loaded.
  217. For applications where chat is not the main feature, automatic focus of the
  218. chat box might be undesired.
  219. auto_list_rooms
  220. ---------------
  221. * Default: ``false``
  222. If true, and the XMPP server on which the current user is logged in supports
  223. multi-user chat, then a list of rooms on that server will be fetched in the
  224. "Query for Groupchats" modal.
  225. Not recommended for servers with lots of chatrooms.
  226. For each room on the server a query is made to fetch further details (e.g.
  227. features, number of occupants etc.), so on servers with many rooms this
  228. option will create lots of extra connection traffic.
  229. If the `muc_domain`_ is locked with the `locked_muc_domain`_ setting, then
  230. rooms will automatically be fetched in the "Query for Groupchats" modal,
  231. regardless of the value of this setting.
  232. .. _`auto_login`:
  233. auto_login
  234. ----------
  235. * Default: ``false``
  236. This option can be used to let Converse automatically log the user in as
  237. soon as the page loads.
  238. If `authentication`_ is set to ``login``, then you will also need to provide a
  239. valid ``jid`` and ``password`` values, either manually by passing them in, or
  240. by the `credentials_url`_ setting. Setting a ``credentials_url`` is preferable
  241. to manually passing in ``jid`` and ``password`` values, because it allows
  242. better reconnection with `auto_reconnect`_. When the connection drops,
  243. Converse will automatically fetch new login credentials from the
  244. ``credentials_url`` and reconnect.
  245. If `authentication`_ is set to ``anonymous``, then you will also need to provide the
  246. server's domain via the `jid`_ setting.
  247. This is a useful setting if you'd like to create a custom login form in your
  248. website. You'll need to write some JavaScript to accept that custom form's
  249. login credentials, then you can pass those credentials (``jid`` and
  250. ``password``) to ``converse.initialize`` to start Converse and log the user
  251. in to their XMPP account.
  252. .. note::
  253. The interaction between ``keepalive`` and ``auto_login`` is unfortunately
  254. inconsistent depending on the `authentication`_ method used.
  255. If ``auto_login`` is set to ``false`` and `authentication`_ is set to
  256. ``anonymous``, ``external`` or ``prebind``, then Converse won't automatically
  257. log the user in.
  258. If `authentication`_ set to ``login`` the situation is much more
  259. ambiguous, since we don't have a way to distinguish between wether we're
  260. restoring a previous session (``keepalive``) or whether we're
  261. automatically setting up a new session (``auto_login``).
  262. So currently if EITHER ``keepalive`` or ``auto_login`` is ``true`` and
  263. `authentication`_ is set to ``login``, then Converse will try to log the user in.
  264. auto_away
  265. ---------
  266. * Default: ``0``
  267. The amount of seconds after which the user's presence status should
  268. automatically become ``away``.
  269. If the user's status is ``extended away``, it won't be changed to ``away``.
  270. If the given value is negative or ``0``, this option is disabled.
  271. auto_xa
  272. -------
  273. * Default: ``0``
  274. The amount of seconds after which the user's presence status should
  275. automatically become ``extended away``.
  276. If the value is negative or ``0``, the function is disabled.
  277. auto_reconnect
  278. --------------
  279. * Default: ``false``
  280. Automatically reconnect to the XMPP server if the connection drops
  281. unexpectedly.
  282. This option works best when you have `authentication`_ set to ``prebind`` and have
  283. also specified a ``prebind_url`` URL, from where Converse can fetch the BOSH
  284. tokens. In this case, Converse will automaticallly reconnect when the
  285. connection drops but also reestablish earlier lost connections (due to
  286. network outages, closing your laptop etc.).
  287. When `authentication`_ is set to `login`, then this option will only work when
  288. the page hasn't been reloaded yet, because then the user's password has been
  289. wiped from memory. This configuration can however still be useful when using
  290. Converse in desktop apps, for example those based on `CEF <https://bitbucket.org/chromiumembedded/cef>`_
  291. or `electron <http://electron.atom.io/>`_.
  292. auto_register_muc_nickname
  293. --------------------------
  294. * Default: ``false``
  295. * Allowed values: ``false``, ``true``, ``'unregister'``
  296. If truthy, Converse will automatically register a user's nickname upon entering
  297. a groupchat.
  298. See here fore more details: https://xmpp.org/extensions/xep-0045.html#register
  299. If set to ``'unregister'``, then the user's nickname will be registered
  300. (because it's a truthy value) and also be unregistered when the user
  301. permanently leaves the MUC by closing it.
  302. auto_subscribe
  303. --------------
  304. * Default: ``false``
  305. If true, the user will automatically subscribe back to any contact requests.
  306. auto_join_on_invite
  307. -------------------
  308. * Default: ``false``
  309. If true, the user will automatically join a chatroom on invite without any confirm.
  310. Also inviting users won't be prompted for a reason.
  311. auto_join_private_chats
  312. -----------------------
  313. * Default: ``[]``
  314. Allows you to provide a list of user JIDs for private (i.e. single) chats that
  315. should automatically be started upon login.
  316. For example::
  317. `['tom@example.org', 'dick@example.org', 'harry@example.org']`
  318. auto_join_rooms
  319. ---------------
  320. * Default: ``[]``
  321. This settings allows you to provide a list of groupchat conversations to be
  322. automatically joined once the user has logged in.
  323. You can either specify a simple list of room JIDs, in which case your nickname
  324. will be taken from your JID, or you can specify a list of maps, where each map
  325. specifies the room's JID and other options.
  326. For example::
  327. `[{'jid': 'room@example.org', 'nick': 'WizardKing69', 'minimized': true }]`
  328. blacklisted_plugins
  329. -------------------
  330. * Default: ``[]``
  331. A list of plugin names that are blacklisted and will therefore not be
  332. initialized once ``converse.initialize`` is called, even if the same plugin is
  333. whitelisted.
  334. From Converse 3.0 onwards most of the API is available only to plugins and
  335. all plugins need to be whitelisted first.
  336. The usecase for blacklisting is generally to disable removed core plugins
  337. (which are automatically whitelisted) to prevent other (potentially malicious)
  338. plugins from registering themselves under those names.
  339. The core, and by default whitelisted, plugins are::
  340. converse-bosh
  341. converse-bookmarks
  342. converse-chatboxes
  343. converse-chatview
  344. converse-controlbox
  345. converse-core
  346. converse-disco
  347. converse-dragresize
  348. converse-fullscreen
  349. converse-headline
  350. converse-mam
  351. converse-minimize
  352. converse-muc
  353. converse-muc-embedded
  354. converse-notification
  355. converse-ping
  356. converse-profile
  357. converse-register
  358. converse-roomslist
  359. converse-rosterview
  360. converse-singleton
  361. converse-smacks
  362. converse-spoilers
  363. converse-vcard
  364. Example:
  365. .. code-block:: javascript
  366. require(['converse-core', 'converse-muc-embedded'], function (converse) {
  367. converse.initialize({
  368. // other settings removed for brevity
  369. blacklisted_plugins: [
  370. 'converse-dragresize',
  371. 'converse-minimize'
  372. ],
  373. });
  374. });
  375. .. _`bosh-service-url`:
  376. bosh_service_url
  377. ----------------
  378. * Default: ``undefined``
  379. Example: ``http://xmpp.example.com:5280/bosh/``
  380. Example with reverse-proxy and TLS: ``https://xmpp.example.com/bosh/``
  381. To connect to an XMPP server over HTTP you need a `BOSH <https://en.wikipedia.org/wiki/BOSH>`_
  382. connection manager which acts as a middle man between the HTTP and XMPP
  383. protocols.
  384. The bosh_service_url setting takes the URL of a BOSH connection manager.
  385. Please refer to your XMPP server's documentation on how to enable BOSH.
  386. 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>`_
  387. A more modern alternative to BOSH is to use `websockets <https://developer.mozilla.org/en/docs/WebSockets>`_.
  388. Please see the :ref:`websocket-url` configuration setting.
  389. clear_cache_on_logout
  390. ---------------------
  391. * Default: ``false``
  392. If set to ``true``, all locally cached data will be cleared when the user logs out,
  393. regardless of the `persistent_store`_ being used (``localStorage``, ``IndexedDB`` or ``sessionStorage``).
  394. *Note*: If `allow_user_trust_override`_ is set to ``true`` and the user
  395. indicates that this device/browser is **not** trusted, then the cache will be
  396. cleared on logout, even if this setting is set to ``true``.
  397. *Note*: If this setting is set to ``true``, then OMEMO will be disabled, since
  398. otherwise it won't be possible to decrypt archived messages that were
  399. already decrypted previously (due to forward security).
  400. clear_messages_on_reconnection
  401. ------------------------------
  402. * Default: ``false``
  403. In some cases, it might be desirable to clear cached chat messages once you've
  404. reconnected to the XMPP server.
  405. For example, if you want to prevent the chat history from getting too long or
  406. if you want to avoid gaps in the chat history (for example due to MAM not
  407. returning all messages since the last cached message).
  408. Beware, if you're using OMEMO, then you probably don't want to set this setting to
  409. ``true``. OMEMO messages can be decrypted only once, so if they then
  410. subsequently get cleared, you won't get the plaintext back.
  411. chatstate_notification_blacklist
  412. --------------------------------
  413. * Default: ``[]``
  414. A list of JIDs to be ignored when showing desktop notifications of changed chat states.
  415. Some user's clients routinely connect and disconnect (likely on mobile) and
  416. each time a chat state notificaion is received (``online`` when connecting and
  417. then ``offline`` when disconnecting).
  418. When desktop notifications are turned on (see `show-desktop-notifications`_),
  419. then you'll receive notification messages each time this happens.
  420. Receiving constant notifications that a user's client is connecting and disconnecting
  421. is annoying, so this option allows you to ignore those JIDs.
  422. connection_options
  423. ------------------
  424. * Default: ``{}``
  425. * Type: Object
  426. Converse relies on `Strophe.js <http://strophe.im>`_ to establish and
  427. maintain a connection to the XMPP server.
  428. This option allows you to pass a map of configuration options to be passed into
  429. the ``Strophe.Connection`` constructor.
  430. For documentation on the configuration options that ``Strophe.Connection``
  431. accepts, refer to the
  432. `Strophe.Connection documentation <http://strophe.im/strophejs/doc/1.2.8/files/strophe-js.html#Strophe.Connection.Strophe.Connection>`_.
  433. Restricting the supported authentication mechanisms:
  434. ****************************************************
  435. As an example, suppose you want to restrict the supported SASL authentication
  436. mechanisms, then you'd pass in the ``mechanisms`` as a ``connection_options``
  437. ``key:value`` pair:
  438. .. code-block:: javascript
  439. converse.initialize({
  440. connection_options: {
  441. 'mechanisms': [
  442. converse.env.Strophe.SASLMD5,
  443. ]
  444. }
  445. });
  446. Running the XMPP Connection inside a shared worker
  447. **************************************************
  448. Newer versions of Strophe.js, support the ability to run the XMPP Connection
  449. inside a `shared worker <https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker>`_ that's shared
  450. between open tabs in the browser in which Converse is running (and which have the same domain).
  451. *Note:* This feature is experimental and there currently is no way to
  452. synchronize actions between tabs. For example, sent 1-on-1 messages aren't
  453. reflected by the server, so you if you send such a message in one tab, it won't
  454. appear in another.
  455. .. code-block:: javascript
  456. converse.initialize({
  457. connection_options: { worker: '/dist/shared-connection-worker.js' }
  458. });
  459. .. _`credentials_url`:
  460. credentials_url
  461. ---------------
  462. * Default: ``null``
  463. * Type: URL
  464. This setting should be used in conjunction with `authentication`_ set to ``login``.
  465. It allows you to specify a URL which Converse will call when it needs to get
  466. the username and password (or authentication token) which Converse will use
  467. to automatically log the user in.
  468. If `auto_reconnect`_ is also set to ``true``, then Converse will automatically
  469. fetch new credentials from the ``credentials_url`` whenever the connection or
  470. session drops, and then attempt to reconnect and establish a new session.
  471. If the request to the ``credentials_url`` URL fails for whatever reason,
  472. Converse will continuously retry to fetch the credentials every 2 seconds.
  473. The server behind ``credentials_url`` should return a JSON encoded object::
  474. {
  475. "jid": "me@example.com/resource",
  476. "password": "Ilikecats!"
  477. }
  478. csi_waiting_time
  479. ----------------
  480. * Default: ``0``
  481. This option adds support for `XEP-0352 Client State Indication <https://xmpp.org/extensions/xep-0352.html>_`
  482. If Converse is idle for the configured amount of seconds, a chat state
  483. indication of ``inactive`` will be sent out to the XMPP server (if the server
  484. supports CSI).
  485. Afterwards, ss soon as there is any activity (for example, the mouse moves),
  486. a chat state indication of ``active`` will be sent out.
  487. A value of ``0`` means that this feature is disabled.
  488. .. _`loglevel`:
  489. loglevel
  490. --------
  491. * Default: ``'info'``
  492. * Allowed values: ``'debug'``, ``'info'``, ``'warn'``, ``'error'``, ``'fatal'``
  493. You can also set this value by changing a URL fragment `#converse?loglevel=debug`
  494. .. _`dark_theme`:
  495. dark_theme
  496. ----------
  497. * Default: ``'dracula'``
  498. The theme being used in dark mode.
  499. default_domain
  500. --------------
  501. * Default: ``undefined``
  502. Specify a domain to act as the default for user JIDs. This allows users to log
  503. in with only the username part of their JID, instead of the full JID.
  504. For example, if ``default_domain`` is ``example.org``, then the user
  505. ``johnny@example.org`` can log in with only ``johnny``.
  506. JIDs with other domains are still allowed but need to be provided in full.
  507. To specify only one domain and disallow other domains, see the `locked_domain`_
  508. option.
  509. default_state
  510. -------------
  511. * Default: ``'online'``
  512. The default chat status that the user wil have. If you for example set this to
  513. ``'chat'``, then Converse will send out a presence stanza with ``"show"``
  514. set to ``'chat'`` as soon as you've been logged in.
  515. discover_connection_methods
  516. ---------------------------
  517. * Default: ``true``
  518. Use `XEP-0156 <https://xmpp.org/extensions/xep-0156.html>`_ to discover whether
  519. the XMPP host for the current user advertises any Websocket or BOSH connection
  520. URLs that can be used.
  521. If this is set to ``false``, then a `websocket_url`_ or `bosh_service_url`_ need to be
  522. set.
  523. Currently only the XML encoded host-meta resource is supported as shown in
  524. `Example 2 under section 3.3 <https://xmpp.org/extensions/xep-0156.html#httpexamples>`_.
  525. domain_placeholder
  526. ------------------
  527. * Default: ``e.g. conversejs.org``
  528. The placeholder text shown in the domain input on the registration form.
  529. emoji_categories
  530. ----------------
  531. * Default:
  532. ::
  533. {
  534. "smileys": ":grinning:",
  535. "people": ":thumbsup:",
  536. "activity": ":soccer:",
  537. "travel": ":motorcycle:",
  538. "objects": ":bomb:",
  539. "nature": ":rainbow:",
  540. "food": ":hotdog:",
  541. "symbols": ":musical_note:",
  542. "flags": ":flag_ac:",
  543. "custom": null
  544. }
  545. This setting lets you define the categories that are available in the emoji
  546. picker, as well as the default image that's shown for each category.
  547. The keys of the map are the categories and the values are the shortnames of the
  548. representative images.
  549. If you want to remove a category, don't just remove the key, instead set its
  550. value to ``undefined``.
  551. Due to restrictions intended to prevent addition of undeclared configuration
  552. settings, it's not possible to add new emoji categories. There is however a
  553. ``custom`` category where you can put your own custom emojis (also known as
  554. "stickers").
  555. Please note that the ``custom`` category is disabled by default, as it does not
  556. rely on a standard for now, and will only work for users that are using versions
  557. of Converse that support it.
  558. To enable the ``custom`` category, set it to one of the keys under the
  559. ``custom`` section in ``src/headless/plugins/emoji/emojis.json`` (for example
  560. ``:converse:``). You can also add new entries there, to create more custom
  561. emojis.
  562. You can also listen for the ``loadEmojis`` hook, that allows you to modify
  563. ``emojis.json`` at runtime.
  564. emoji_categories_label
  565. ----------------------
  566. * Default:
  567. ::
  568. {
  569. "smileys": "Smileys and emotions",
  570. "people": "People",
  571. "activity": "Activities",
  572. "travel": "Travel",
  573. "objects": "Objects",
  574. "nature": "Animals and nature",
  575. "food": "Food and drink",
  576. "symbols": "Symbols",
  577. "flags": "Flags",
  578. "custom": "Stickers"
  579. }
  580. This setting lets you pass in the text value that goes into the `title`
  581. attribute for the emoji categories. These strings will be translated, but for
  582. your custom text to be translatable, you'll need to wrap it in `__()``
  583. somewhere in your own code.
  584. emoji_image_path
  585. ----------------
  586. * Default: ``'https://twemoji.maxcdn.com/2/'``
  587. When `use_system_emojis`_ is set to ``false``, then this is the URL from where image files for
  588. displaying emojis will be fetched.
  589. enable_muc_push
  590. ---------------
  591. * Default: ``false``
  592. If true, then Converse will try to register
  593. `XEP-0357 push notification App Server(s) <https://xmpp.org/extensions/xep-0357.html#general-architecture>`_
  594. for the MUC domain of any newly entered groupchat.
  595. The app servers are specified with the `push_app_servers`_ option.
  596. .. note::
  597. Registering a push app server against a MUC domain is not (yet) standardized
  598. and this feature should be considered experimental.
  599. enable_smacks
  600. -------------
  601. * Default: ``true``
  602. Determines whether `XEP-0198 Stream Management <https://xmpp.org/extensions/xep-0198.html>`_
  603. support is turned on or not.
  604. Recommended to set to ``true`` if a websocket connection is used.
  605. Please see the :ref:`websocket-url` configuration setting.
  606. filter_by_resource
  607. ------------------
  608. * Default: ``false``
  609. Before version 1.0.3 Converse would ignore received messages if they were
  610. intended for a different resource then the current user had. It was decided to
  611. drop this restriction but leave it configurable.
  612. filter_url_query_params
  613. -----------------------
  614. * Default: ``null``
  615. Accepts a string or array of strings. Any query strings from URLs that match this setting will be removed.
  616. geouri_regex
  617. ------------
  618. * Default: ``/https:\/\/www.openstreetmap.org\/.*#map=[0-9]+\/([\-0-9.]+)\/([\-0-9.]+)\S*/g``
  619. Regular expression used to extract geo coordinates from links to openstreetmap.
  620. geouri_replacement
  621. ------------------
  622. * Default: ``'https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2'``
  623. String used to replace geo-URIs with. Ought to be a link to osm or similar. ``$1`` and ``$2`` is replaced by
  624. latitude and longitude respectively.
  625. hide_muc_participants
  626. ---------------------
  627. * Default: ``false``
  628. Option which allows you to hide the participants list by default.
  629. hide_offline_users
  630. ------------------
  631. * Default: ``false``
  632. If set to ``true``, then offline users aren't shown in the roster.
  633. .. _`i18n`:
  634. i18n
  635. ----
  636. * Default: Auto-detection of the User/Browser language or ``en``;
  637. Specify the locale/language.
  638. The translations for that locale must be served in JSON format at `/dist/locales/${i18n}-LC_MESSAGES-converse-po.js`.
  639. The default webpack configuration for Converse.js ensures that these files are
  640. generated and placed in the right location.
  641. If an explicit locale is specified via the ``i18n`` setting and the
  642. translations for that locale are not found, then Converse will fall back to trying to determine the browser's language
  643. and fetching those translations, or if that fails the default English strings will be used.
  644. idle_presence_timeout
  645. ---------------------
  646. * Default: ``300``
  647. The amount of seconds after which the user is considered to be idle
  648. and an idle presence according to XEP-0319 is sent.
  649. If the given value is negative or ``0``, this feature is disabled.
  650. image_urls_regex
  651. ----------------
  652. * Default: ``null``
  653. Any URL in a message that matches the regex in this setting will be considered an image and rendered, if `show_images_inline`_ is set to ``true``.
  654. If the image cannot be rendered, a hyperlink will be rendered instead.
  655. For example, to render Imgur images inline, you can use the following regex: ``/^https?:\/\/(?:www.)?(?:imgur\.com\/\w{7})\/?$/i``
  656. jid
  657. ---
  658. The Jabber ID or "JID" of the current user. The JID uniquely identifies a user
  659. on the XMPP network. It looks like an email address, but it's used for instant
  660. messaging instead.
  661. This value may be provided together with a ``password`` instead of supplying a
  662. `credentials_url`_ when setting ``auto_login`` to ``true``.
  663. .. _`keepalive`:
  664. keepalive
  665. ---------
  666. * Default: ``true``
  667. Determines whether Converse will attempt to keep you logged in across page loads.
  668. .. _`locales`:
  669. locales
  670. -------
  671. * Default:
  672. .. code-block:: javascript
  673. locales: [
  674. 'af', 'ca', 'de',
  675. 'es', 'en', 'fr',
  676. 'he', 'hu', 'id',
  677. 'it', 'ja', 'nb',
  678. 'nl', 'pl', 'pt_BR',
  679. 'ru', 'uk', 'zh'
  680. ]
  681. This setting restricts the locales that are supported by Converse and
  682. therefore what may be given as value for the :ref:`i18n` option.
  683. Any other locales will be ignored.
  684. locked_domain
  685. -------------
  686. * Default: ``undefined``
  687. Similar to `default_domain`_ but no other domains are allowed.
  688. For example, if ``locked_domain`` is set to ``example.org``, then the user
  689. ``johnny@example.org`` can log in with only ``johnny``.
  690. Additionally, only users registered on the ``example.org`` host can log in, no
  691. other users are allowed to log in.
  692. locked_muc_domain
  693. -----------------
  694. * Default: ``false``
  695. * Allowed values: ``false``, ``true``, ``'hidden'``
  696. By setting this value to something truthy, you restrict the multi-user chat (MUC) domain to only the value
  697. specified in `muc_domain`_.
  698. If the value is set to `'hidden'` (which is also truthy), then the MUC domain
  699. will not be shown to users.
  700. locked_muc_nickname
  701. -------------------
  702. * Default: ``false``
  703. This setting allows you to restrict the multi-user chat (MUC) nickname that a
  704. user uses to a particular value.
  705. Where the nickname value comes from depends on other settings.
  706. The `nickname`_ configuration setting takes precedence ahead of any other
  707. nickname value. If that's not set, then the "nickname" value from the user's
  708. VCard is taken, and if that is not set but `muc_nickname_from_jid`_ is set to
  709. ``true``, then the node of the user's JID (the part before the ``@``) is used.
  710. If no nickame value is found, then an error will be raised.
  711. mam_request_all_pages
  712. ---------------------
  713. * Default: ``true``
  714. When requesting messages from the archive, Converse will ask only for messages
  715. newer than the most recent cached message.
  716. When there are many archived messages since that one, the returned results will
  717. be broken up in to pages, set by `archived_messages_page_size`_.
  718. By default Converse will request all the pages until all messages have been
  719. fetched, however for large archives this can slow things down dramatically.
  720. This setting turns the paging off, and Converse will only fetch the latest
  721. page.
  722. .. note::
  723. If paging is turned off, there will appear gaps in the message history.
  724. Converse currently doesn't yet have a way to inform the user of these gaps or
  725. to let them be filled.
  726. muc_hats
  727. --------
  728. * Default: ``['xep317']``
  729. Since version 7 Converse now has rudimentary support for `XEP-0317 Hats <https://xmpp.org/extensions/xep-0317.html>`_.
  730. It is also possible to display VCard roles, MUC affiliation and MUC role along with hats.
  731. By default only XEP-0317 hats are considered.
  732. For the inclusion of VCard roles ``'vcard_roles'`` must be added to the list.
  733. For the inclusion of MUC affiliation and MUC role, the specific affiliations and roles
  734. to be used must be added to the list e.g. ``'owner','participant'``.
  735. Example:
  736. For XEP-0317 hats and VCard roles this setting should be set to:
  737. ``'muc_hats': ['xep317', 'vcard_roles']``
  738. For VCard roles, admin MUC affiliation and moderator MUC role:
  739. ``'muc_hats': ['vcard_roles', 'admin', 'moderator']``
  740. And to prevent the displaying of anything, an empty list must be used:
  741. ``'muc_hats': []``
  742. muc_mention_autocomplete_min_chars
  743. -----------------------------------
  744. * Default: ``0``
  745. The number of characters that need to be entered before the auto-complete list
  746. of matching nicknames is shown.
  747. muc_mention_autocomplete_filter
  748. -------------------------------
  749. * Default: ``contains``
  750. The method used for filtering MUC participants when using auto-complete.
  751. Valid values are ``contains`` and ``starts_with``.
  752. muc_mention_autocomplete_show_avatar
  753. ------------------------------------
  754. * Default: ``true``
  755. Show avatars of MUC participants when using auto-complete.
  756. message_archiving
  757. -----------------
  758. * Default: ``undefined``
  759. Provides support for `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
  760. whereby messages are archived in the XMPP server for later retrieval.
  761. Note, your XMPP server must support XEP-0313 MAM for this to work.
  762. This option sets the default archiving preference.
  763. Valid values are ``undefined``, ``never``, ``always`` and ``roster``.
  764. ``undefined`` means that any existing MAM configuration, as set by the user or
  765. the server administrator, will be used.
  766. ``roster`` means that only messages to and from JIDs in your roster will be
  767. archived. The other two values are self-explanatory.
  768. message_archiving_timeout
  769. -------------------------
  770. * Default: ``20000``
  771. The amount of time (in milliseconds) to wait when requesting archived messages
  772. from the XMPP server.
  773. Used in conjunction with ``message_archiving`` and in context of `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_.
  774. message_limit
  775. -------------
  776. * Default: ``0``
  777. Determines the allowed amount of characters in a chat message. A value of zero means there is no limit.
  778. Note, this limitation only applies to the Converse UX code running in the browser
  779. and it's trivial for an attacker to bypass this restriction.
  780. You should therefore also configure your XMPP server to limit message sizes.
  781. modtools_disable_assign
  782. -----------------------
  783. * Default: ``false``
  784. * Possible Values: ``true``, ``false``, ``['owner', 'admin', 'member', 'outcast', 'none', 'moderator', 'participant', 'visitor']``
  785. This setting allows you to disable (either completely, or fine-grained) which affiliations and or roles
  786. may be assigned in the moderator tools modal.
  787. modtools_disable_query
  788. ----------------------
  789. * Default: ``[]``
  790. * Possible Values: ``['owner', 'admin', 'member', 'outcast', 'none', 'moderator', 'participant', 'visitor']``
  791. This setting allows you to disable which affiliations or roles may be queried in the moderator tools modal.
  792. If all roles or all affiliations are disabled, then the relevant tab won't be
  793. showed at all.
  794. muc_clear_messages_on_leave
  795. ---------------------------
  796. * Default: ``true``
  797. Starting with Converse 8.0.0, when leaving a MUC, all cached messages in the history is cleared.
  798. Note: This means that you lose your history of decrypted OMEMO messages and cannot recover it.
  799. muc_disable_slash_commands
  800. --------------------------
  801. * Default: ``false``
  802. Allows you to disable the moderator commands such as ``/kick`` or ``/ban``.
  803. Ìf set to ``true`` all commands will be disabled.
  804. You can also selectively disable some moderator commands by setting it to an
  805. array of commands you don't want.
  806. The following example will disable 'mute' and 'voice' command:
  807. .. code-block:: javascript
  808. muc_disable_slash_commands: ['mute', 'voice'],
  809. muc_domain
  810. ----------
  811. * Default: ``undefined``
  812. The default MUC (multi-user chat) domain that should be used.
  813. When setting this value, users can only enter the name when opening a new MUC,
  814. and don't have to add the whole address (i.e. including the domain part).
  815. Users can however still enter the domain and they can still open MUCs with
  816. other domains.
  817. If you want to restrict MUCs to only this domain, then set `locked_muc_domain`_ to
  818. ``true``.
  819. muc_fetch_members
  820. -----------------
  821. * Default: ``true``
  822. * Possible values: Array containing any of the following: ``['member', 'admin', 'owner']``
  823. Determines whether Converse.js will fetch the member lists for a MUC
  824. (multi-user chat) when the user first enters it.
  825. Here's the relevant part from the MUC XEP: https://xmpp.org/extensions/xep-0045.html#getmemberlist
  826. The MUC service won't necessarily allow any user to fetch member lists,
  827. but can usually be configured to do so.
  828. The member lists consists of three lists of users who have the affiliations
  829. ``member``, ``admin`` and ``owner`` respectively.
  830. By fetching member lists, Converse.js will always show these users as
  831. participants of the MUC, giving them a permanent "presence" in the MUC.
  832. muc_grouped_by_domain
  833. ---------------------
  834. * Default: ``false``
  835. If ``true``, displays MUCS of a same domain together, in collapsible groups.
  836. muc_history_max_stanzas
  837. -----------------------
  838. * Default: ``undefined``
  839. This option allows you to specify the maximum amount of messages to be shown in a
  840. chatroom when you enter it. By default, the amount specified in the room
  841. configuration or determined by the server will be returned.
  842. Please note, this option is not related to
  843. `XEP-0313 Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
  844. which also allows you to show archived chatroom messages, but follows a
  845. different approach.
  846. If you're using MAM for archiving chatroom messages, you might want to set
  847. this option to zero.
  848. muc_instant_rooms
  849. ------------------
  850. * Default: ``true``
  851. Determines whether 'instant' (also called 'dynamic' in OpenFire) rooms are created.
  852. Otherwise rooms first have to be configured before they're available to other
  853. users (so-called "registered rooms" in `MUC-0045 <https://xmpp.org/extensions/xep-0045.html#createroom>`_).
  854. From a UX perspective, if this settings is `false`, then a configuration form will
  855. render, that has to be filled in first, before the room can be joined by other
  856. users.
  857. muc_nickname_from_jid
  858. ---------------------
  859. * Default: ``false``
  860. When set to ``true``, then users will not be prompted to provide nicknames for
  861. chatrooms. Instead, the node part of a user's JID (i.e. JID = node@domain/resource)
  862. will be used. If the user's nickname is already taken by another user in the
  863. chatroom, then an integer will be added to make it unique.
  864. So, for example, if john@example.com joins a chatroom, his nickname will
  865. automatically be "john". If now john@differentdomain.com tries to join the
  866. room, his nickname will be "john-2", and if john@somethingelse.com joins, then
  867. his nickname will be "john-3", and so forth.
  868. muc_search_service
  869. ------------------
  870. * Default: ``'api@search.jabber.network'``
  871. The JID of the service that should be used to search for MUCs for auto-complete
  872. purposes. If this value is set to an empty string, no service will be used and
  873. the auto-complete feature for adding MUCs will be disabled.
  874. muc_send_probes
  875. ---------------
  876. * Default: ``false``
  877. If set to ``true``, then whenever Converse receives a MUC message with an author for which we don't have
  878. any information (i.e. because that user is currently not in the MUC), then Converse will send out a ``<presence>``
  879. stanza of type ``probe`` in order to request the authors presence data.
  880. Prosody has support in `trunk` for this.
  881. The point of sending out presence probes is in order to receive
  882. presence-related metadata, such as `XEP-0317 Hats <https://xmpp.org/extensions/xep-0317.html>`_.
  883. .. note::
  884. Although this behavior is described in the `presence business rules of XEP-0045, section 17.3 point 4 <https://xmpp.org/extensions/xep-0045.html#bizrules-presence>`_,
  885. few XMPP servers support this.
  886. .. note::
  887. If member lists are fetched via muc_fetch_members, then the occupants created
  888. based on those member lists won't be probed again later (given that the
  889. occupants are already created). Certain metadata like XEP-0317 hats are not
  890. included in the member lists, which means that this metadata will be missing for
  891. those occupants.
  892. muc_respect_autojoin
  893. --------------------
  894. * Default; ``true``
  895. Determines whether Converse will respect the autojoin-attribute of bookmarks. Per default
  896. all MUCs with set autojoin flag in their respective bookmarks will be joined on
  897. startup of Converse. When set to ``false`` no MUCs are automatically joined based on
  898. their bookmarks.
  899. muc_roomid_policy
  900. -----------------
  901. * Default: ``null``
  902. This option defines the regular expression that a room id must satisfy to allow the
  903. room creation. Server administrators may want to impose restrictions on the minimum
  904. and maximum length and the allowed character set allowed for room ids. Otherwise
  905. users might create rooms which are difficult to handle.
  906. However, restricting that on the server only leads to bad UX as users might learn of
  907. the servers policy only after they have tried to create a room. Furthermore error
  908. messages from XMPP-servers might not be self-explanatory.
  909. Therefore this option allows converse to already check the policy and disallow the
  910. user from even trying to entering/creating such a room.
  911. As this only makes sense on your own server, the check is applied only if the domain
  912. part equals `muc_domain`_. If `muc_domain`_ is unset, then this check is disabled
  913. completely.
  914. Example:
  915. .. code-block:: javascript
  916. muc_roomid_policy: /^[a-z0-9._-]{5,40}$/,
  917. See also: `muc_roomid_policy_hint`_
  918. muc_roomid_policy_hint
  919. ----------------------
  920. * Default: ``null``
  921. This option can be used in conjuction with `muc_roomid_policy`_ in order to give
  922. a written explanation of the imposed room id policy. You can use the html-tags
  923. ``<br>``, ``<b>``, and ``<em>`` to allow some basic styling.
  924. Example:
  925. .. code-block:: javascript
  926. muc_roomid_policy_hint: '<br><b>Policy for groupchat id:</b><br>- between 5 and 40 characters,<br>- lowercase from a to z (no special characters) or<br>- digits or<br>- dots (.) or<br>- underlines (_) or<br>- hyphens (-),<br>- no spaces<br>',
  927. muc_show_info_messages
  928. ----------------------
  929. * Default: List composed of MUC status codes, role changes, join and leave events and affiliation changes. The values of converse.MUC_INFO_CODES below are joined to build the default list:
  930. .. code-block:: javascript
  931. converse.MUC_AFFILIATION_CHANGES_LIST = ['owner', 'admin', 'member', 'exowner', 'exadmin', 'exmember', 'exoutcast']
  932. converse.MUC_ROLE_CHANGES_LIST = ['op', 'deop', 'voice', 'mute'];
  933. converse.MUC_TRAFFIC_STATES_LIST = ['entered', 'exited'];
  934. converse.MUC_INFO_CODES = {
  935. 'visibility_changes': ['100', '102', '103', '172', '173', '174'],
  936. 'self': ['110'],
  937. 'non_privacy_changes': ['104', '201'],
  938. 'muc_logging_changes': ['170', '171'],
  939. 'nickname_changes': ['210', '303'],
  940. 'disconnect_messages': ['301', '307', '321', '322', '332', '333'],
  941. 'affiliation_changes': [...converse.AFFILIATION_CHANGES_LIST],
  942. 'join_leave_events': [...converse.MUC_TRAFFIC_STATES_LIST],
  943. 'role_changes': [...converse.MUC_ROLE_CHANGES_LIST],
  944. };
  945. This setting determines which info messages will Converse show inside a chatroom.
  946. It is recommended to use the aforementioned Converse object in the following fashion
  947. to build the list of desired info messages that will be shown:
  948. .. code-block:: javascript
  949. muc_show_info_messages: [
  950. ...converse.MUC_INFO_CODES.visibility_changes,
  951. ...converse.MUC_INFO_CODES.self,
  952. ...converse.MUC_INFO_CODES.non_privacy_changes,
  953. ...converse.MUC_INFO_CODES.muc_logging_changes,
  954. ...converse.MUC_INFO_CODES.nickname_changes,
  955. ...converse.MUC_INFO_CODES.disconnect_messages,
  956. ...converse.MUC_INFO_CODES.affiliation_changes,
  957. ...converse.MUC_INFO_CODES.join_leave_events,
  958. ...converse.MUC_INFO_CODES.role_changes,
  959. ]
  960. By default all info messages are shown.
  961. The behaviour of this setting is whitelisting, so if it is overriden all the desired
  962. events must be specified.
  963. If an empty list is provided, no info message will be displayed at all.
  964. muc_show_logs_before_join
  965. -------------------------
  966. * Default: ``false``
  967. If set to ``true``, when opening a MUC for the first time (or if you don't have
  968. a nickname configured for it), you'll see the message history (if the
  969. server supports `XEP-0313 Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_)
  970. and the nickname form at the bottom.
  971. muc_subscribe_to_rai
  972. --------------------
  973. * Default: ``false``
  974. This option enables support for `XEP-0437 Room Activity Indicators <https://xmpp.org/extensions/xep-0437.html>`_.
  975. When a MUC is no longer visible (specifically, when the ``hidden`` flag becomes ``true``),
  976. then Converse will exit the MUC and subscribe to activity indicators on the MUC host.
  977. When the MUC becomes visible again (``hidden`` gets set to ``false``), the MUC will be rejoined.
  978. .. _`nickname`:
  979. nickname
  980. --------
  981. * Default: ``undefined``
  982. This setting allows you to specify the nickname for the current user.
  983. The nickname will be included in presence requests to other users and will also
  984. be used as the default nickname when entering MUC chatrooms.
  985. This value will have first preference ahead of other nickname sources, such as
  986. the VCard ``nickname`` value.
  987. notify_all_room_messages
  988. ------------------------
  989. * Default: ``false``
  990. By default, sound and desktop notifications will only be made when you are
  991. mentioned in a room. If you set this setting to `true`, then you will be
  992. notified of all messages received in a room.
  993. You can also pass an array of room JIDs to this option, to only apply it to
  994. certain rooms.
  995. notification_delay
  996. ------------------
  997. * Default: ``5000``
  998. Desktop notifications will be shown for a time of ``notification_delay``
  999. ms. Setting this to ``0`` will make the notification stay until dismissed by
  1000. the user (requires browser support).
  1001. notification_icon
  1002. -----------------
  1003. * Default: ``'logo/conversejs-filled.svg'``
  1004. This option specifies which icon is shown in HTML5 notifications, as provided
  1005. by the ``src/converse-notification.js`` plugin.
  1006. notify_nicknames_without_references
  1007. -----------------------------------
  1008. * Default: ``false``
  1009. Enables notifications for nicknames in messages that don't have associated
  1010. XEP-0372 references linking them to the JID of the person being mentioned.
  1011. In Converse, these would be nicknames that weren't mentioned via the ``@`` sign.
  1012. oauth_providers
  1013. ---------------
  1014. * Default: ``[]``
  1015. Allows you to specify a list of OAuth providers that the user may use to log in
  1016. with.
  1017. .. note::
  1018. Your XMPP server will have to support Oauth logins
  1019. .. code-block:: javascript
  1020. converse.initialize({
  1021. oauth_providers: {
  1022. 'github': {
  1023. 'client_id': '1338d9f7ff52b1309b29',
  1024. 'host': 'chat.example.org',
  1025. 'class': 'fa-github-alt',
  1026. 'id': 'github',
  1027. 'name': 'Github'
  1028. },
  1029. 'twitter': {
  1030. 'client_id': '0332d98cff83b1999b22',
  1031. 'host': 'chat.example.org',
  1032. 'class': 'fa-twitter',
  1033. 'id': 'twitter',
  1034. 'name': 'Twitter'
  1035. }
  1036. },
  1037. });
  1038. omemo_default
  1039. -------------
  1040. * Default: ``false``
  1041. Use OMEMO encryption by default when the chat supports it.
  1042. ping_interval
  1043. -------------
  1044. * Default: ``60``
  1045. Make ping to server in order to keep connection with server killing sessions after idle timeout.
  1046. The ping are sent only if no messages are sent in the last ``ping_interval`` seconds
  1047. You need to set the value to any positive value to enable this functionality.
  1048. If you set this value to ``0`` or any negative value, il will disable this functionality.
  1049. .. _`play-sounds`:
  1050. play_sounds
  1051. -----------
  1052. * Default: ``false``
  1053. Plays a notification sound when you receive a personal message or when your
  1054. nickname is mentioned in a chatroom.
  1055. Inside the ``./sounds`` directory of the Converse repo you'll see MP3 and Ogg
  1056. formatted sound files. We need both, because neither format is supported by all browsers.
  1057. You can set the URL where the sound files are hosted with the `sounds_path`_ option.
  1058. Requires the `src/converse-notification.js` plugin.
  1059. .. _`prebind_url`:
  1060. prebind_url
  1061. -----------
  1062. * Default: ``null``
  1063. * Type: URL
  1064. See also: :ref:`session-support`
  1065. This setting should be used in conjunction with `authentication`_ set to `prebind`.
  1066. It allows you to specify a URL which Converse will call when it needs to get
  1067. the RID and SID (Request ID and Session ID) tokens of a BOSH connection, which
  1068. Converse will then attach to.
  1069. The server behind ``prebind_url`` should return a JSON encoded object with the
  1070. three tokens::
  1071. {
  1072. "jid": "me@example.com/resource",
  1073. "sid": "346234623462",
  1074. "rid": "876987608760"
  1075. }
  1076. priority
  1077. --------
  1078. * Default: ``0``
  1079. * Type: Number
  1080. Determines the priority used for presence stanzas sent out from this resource
  1081. (i.e. this instance of Converse).
  1082. The priority of a given XMPP chat client determines the importance of its presence
  1083. stanzas in relation to stanzas received from other clients of the same user.
  1084. In Converse, the indicated chat status of a roster contact will be taken from the
  1085. presence stanza (and associated resource) with the highest priority.
  1086. If multiple resources have the same top priority, then the chat status will be
  1087. taken from the most recent present stanza.
  1088. 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>`_.
  1089. providers_link
  1090. --------------
  1091. * Default: ``https://xmpp.net/directory.php``
  1092. The hyperlink on the registration form which points to a directory of public
  1093. XMPP servers.
  1094. .. _`assets_path`:
  1095. assets_path
  1096. -----------
  1097. * Default: ``'/dist/'`` or the `publicPath <https://webpack.js.org/guides/public-path/>`_
  1098. value as configured in the relevant Webpack configuration.
  1099. Since version 5.0.0, Converse serves a smaller bundle by extracting various
  1100. resources (for example emojis and translations) into separate files (aka
  1101. "chunks") which are loaded asynchronously on demand.
  1102. The URL path at which these resources are loaded is normally set by the ``publicPath``
  1103. setting of Webpack but this means that it's hardcoded to a particular value at
  1104. compile time.
  1105. This configuration seting allows this value to be set at runtime as well.
  1106. .. _persistent-store:
  1107. persistent_store
  1108. ----------------
  1109. * Default: ``IndexedDB``
  1110. * Valid options: ``localStorage``, ``IndexedDB``, ``sessionStorage``, ``BrowserExtLocal``, ``BrowserExtSync``
  1111. Determines which store is used for storing persistent data.
  1112. From version 6.0.0 onwards, Converse supports storing data in
  1113. `IndexedDB <https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB>`_.
  1114. IndexedDB is not subjected to the same space constraints as localStorage and is
  1115. also a requirement for progressive web apps which don't need persistent a
  1116. internet connectivity to be functional.
  1117. From version 7.0.0 onwards, Converse supports storing data in
  1118. `Browser Extension storage <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage#Example_extensions>`_.
  1119. When Converse is running inside a web browser extension, it can now take advantage of storage optimized to meet the specific storage needs of extensions.
  1120. BrowserExtSync represents the sync storage area.
  1121. Items in sync storage are synced by the browser and are available across all instances of that browser that the user is logged into, across different devices.
  1122. BrowserExtLocal represents the local storage area.
  1123. Items in local storage are local to the machine the extension was installed on
  1124. prune_messages_above
  1125. --------------------
  1126. * Default: ``undefined``
  1127. * Valid options: Any integer value above 0.
  1128. If this option is set to a positive integer, the chat history will be kept to
  1129. that number. As new messages come in, older messages will be deleted to
  1130. maintain the history size.
  1131. .. note::
  1132. When deleting locally stored decrypted OMEMO messages, you will **not** be
  1133. able to decrypt them again after fetching them from the server archive.
  1134. pruning_behavior
  1135. ----------------
  1136. * Default: ``unscrolled``
  1137. * Valid options: ``unscrolled``, ``scrolled``
  1138. By default the chat history will only be pruned when the chat window isn't
  1139. scrolled up (``'unscrolled'``).
  1140. If set to ``'scrolled'``, then pruning will also happen when the chat is
  1141. scrolled up. Be aware that this will interfere with MAM-based infinite
  1142. scrolling, and this setting only makes sense when infinite scrolling with MAM
  1143. is disabled.
  1144. push_app_servers
  1145. ----------------
  1146. * Default: ``[]``
  1147. This option lets you enable or disable so-called push notification "App Servers"
  1148. (as per `XEP-0357 <https://xmpp.org/extensions/xep-0357.html>`_).
  1149. For each "App Server" an object needs to be passed in. When enabling, you need
  1150. to specify ``jid`` and ``node`` values. You can also provide a
  1151. ``secret``, if required by your App Server.
  1152. When disabling, you need to specify at least a ``jid`` and set ``disabled`` to
  1153. ``true``. This will disable notifications to all pubsub nodes on that "App
  1154. Server". If you want to disable only a particular node, then specify a ``node``
  1155. value as well.
  1156. For example:
  1157. .. code-block:: javascript
  1158. converse.initialize({
  1159. 'push_app_servers': [{
  1160. 'jid': 'push-4@client.example',
  1161. 'node': 'yxs32uqsflafdk3iuqo',
  1162. 'disable': true
  1163. }, {
  1164. 'jid': 'push-5@client.example',
  1165. 'node': 'yxs32uqsflafdk3iuqo',
  1166. }]
  1167. });
  1168. registration_domain
  1169. -------------------
  1170. * Default: ``''``
  1171. Specify a domain name for which the registration form will be fetched automatically,
  1172. without the user having to enter any XMPP server domain name.
  1173. render_media
  1174. ------------
  1175. * Default: ``true``
  1176. * Possible values: ``true``, ``false`` or an array of domains for which media
  1177. should automatically be rendered.
  1178. If ``true``, media URLs (images, audio and video) will be rendered in the chat.
  1179. If ``false``, the URLs won't render as media, and instead only clickable links
  1180. will be shown.
  1181. Setting it to an array of domains means that media will be rendered only for URLs
  1182. matching those domains.
  1183. Media URLs are those URLs which appear to point to media files as well as URLs
  1184. for which `Open Graph Protocol (OGP) <https://modules.prosody.im/mod_ogp.html>`_
  1185. data was received (for example via Prosody's `mod_ogp <https://modules.prosody.im/mod_ogp.html>`_).
  1186. The OGP metadata must come from the MUC itself, metadata sent from participants
  1187. themselves will not be shown.
  1188. Based on the OGP metadata Converse will render a URL preview (also known as an
  1189. "unfurl").
  1190. .. note::
  1191. Note, even if this setting is ``false`` (or if the URL domain is not in the
  1192. array of allowed domains), a user can still click on the message
  1193. dropdown and click to show or hide the media for that particular message.
  1194. If you want to disable this ability, you can set the allowed domains for the
  1195. media type to an empty array.
  1196. See:
  1197. * `allowed_audio_domains`_
  1198. * `allowed_video_domains`_
  1199. * `allowed_image_domains`_
  1200. .. note::
  1201. This setting, together with the three allowed domain settings above, obsolete
  1202. the ``show_images_inline``, ``embed_audio`` and ``embed_videos`` settings.
  1203. reuse_scram_keys
  1204. ----------------
  1205. * Default: ``true``
  1206. Most XMPP servers enable the Salted Challenge Response Authentication Mechanism
  1207. or SCRAM for short. This allows the user and the server to mutually
  1208. authenticate *without* the need to transmit the user's password in plaintext.
  1209. Assuming the server does not alter the user's password or the
  1210. storage parameters, we can authenticate with the same SCRAM key multiple times.
  1211. This opens an opportunity: we can store the user's login credentials in the
  1212. browser without storing the sensitive plaintext password, or the
  1213. need to set up complicated third party backends, like OAuth.
  1214. Enabling this option will let Converse save a user's SCRAM keys upon successful
  1215. login, and next time Converse is loaded the user will be automatically logged in
  1216. with those SCRAM keys.
  1217. .. _`roomconfig_whitelist`:
  1218. roomconfig_whitelist
  1219. --------------------
  1220. * Default: ``[]``
  1221. A list of room config-option names. If this list is non-empty, only the corresponding room
  1222. config-options will be shown in the room configuration form. The default will show all options.
  1223. In the following example the user can only see (and thus change) the roomname and nothing else:
  1224. .. code-block:: javascript
  1225. roomconfig_whitelist: ['muc#roomconfig_roomname'],
  1226. root
  1227. ----
  1228. * Default: ``window.document``
  1229. When using Converse inside a web component's shadow DOM, you will need to set this settings'
  1230. value to the shadow-root of the shadow DOM.
  1231. For example:
  1232. .. code-block:: javascript
  1233. class CustomChatComponent extends HTMLElement {
  1234. constructor() {
  1235. super();
  1236. const shadowRoot = this.attachShadow({mode: "open"});
  1237. this.initConverse(shadowRoot);
  1238. }
  1239. initConverse(shadowRoot) {
  1240. window.addEventListener("converse-loaded", function(event) {
  1241. const { converse } = event.detail;
  1242. converse.initialize({
  1243. root: shadowRoot,
  1244. // Other settings go here...
  1245. });
  1246. });
  1247. }
  1248. }
  1249. roster_groups
  1250. -------------
  1251. * Default: ``true``
  1252. If set to ``true``, Converse will show any roster groups you might have configured.
  1253. .. note::
  1254. It's currently not possible to use Converse to assign contacts to groups.
  1255. Converse can only show users and groups that were previously configured
  1256. elsewhere.
  1257. send_chat_state_notifications
  1258. -----------------------------
  1259. * Default: ``true``
  1260. * Allowed values: ``'active', 'composing', 'gone' 'inactive', 'paused'``
  1261. Determines whether chat state notifications (see `XEP-0085 <https://xmpp.org/extensions/xep-0085.html>`_) should be sent out or not.
  1262. Can also be set to an Array in order to allow only certain types of chat state notifications.
  1263. For example:
  1264. .. code-block:: javascript
  1265. converse.initialize({
  1266. 'send_chat_state_notifications': ['composing']
  1267. });
  1268. send_chat_markers
  1269. -----------------
  1270. * Default: ``['received', 'displayed', 'acknowledged']``
  1271. Determines which (if any) of the `XEP-0333 <https://xmpp.org/extensions/xep-0333.html>`_ chat markers will be sent out.
  1272. It's still up to Converse to decide when to send out the relevant markers, the
  1273. purpose of this setting is merely to turn on or off the sending of the
  1274. individual markers.
  1275. show_chat_state_notifications
  1276. -----------------------------
  1277. * Default: ``false``
  1278. Specifies whether chat state (online, dnd, away) HTML5 desktop notifications should be shown.
  1279. show_client_info
  1280. ----------------
  1281. * Default: ``true``
  1282. Specifies whether the info icon is shown on the controlbox which when clicked opens an
  1283. "About" modal with more information about the version of Converse being used.
  1284. show_connection_url_input
  1285. -------------------------
  1286. * Default: ``false``
  1287. Determines whether the login form should show an input element where the user
  1288. can enter the connection URL. If it's a websocket url, then upon form
  1289. submission the `websocket_url`_ setting will be updated with this value, and if
  1290. it's an HTTP URL then the `bosh_service_url`_ setting will be updated.
  1291. show_controlbox_by_default
  1292. --------------------------
  1293. * Default: ``false`` (``true`` when the `view_mode`_ is set to ``fullscreen``)
  1294. The "controlbox" refers to the special chatbox containing your contacts roster,
  1295. status widget, chatrooms and other controls.
  1296. By default this box is hidden and can be toggled by clicking on any element in
  1297. the page with class *toggle-controlbox*.
  1298. If this options is set to true, the controlbox will by default be shown upon
  1299. page load.
  1300. However, be aware that even if this value is set to ``false``, if the
  1301. controlbox is open, and the page is reloaded, then it will stay open on the new
  1302. page as well.
  1303. .. _`show-desktop-notifications`:
  1304. show_desktop_notifications
  1305. --------------------------
  1306. * Default: ``true``
  1307. Should HTML5 desktop notifications be shown?
  1308. If set to ``true``, notifications will be shown in the following cases:
  1309. * the browser is not visible nor focused and a private message is received.
  1310. * the browser is not visible nor focused and a groupchat message is received which mentions you.
  1311. * ``auto_subscribe`` is set to ``false`` and a new contact request is received.
  1312. If set to ``all``, notifications will be shown even if the above conditions are
  1313. not fulfilled.
  1314. Requires the `src/converse-notification.js` plugin.
  1315. show_message_avatar
  1316. -------------------
  1317. * Default: ``true``
  1318. Whether chat messages should also render the author's avatar.
  1319. show_images_inline
  1320. ------------------
  1321. * Default: ``true``
  1322. If set to ``false``, images won't be rendered in chats, instead only their links will be shown.
  1323. Users will however still have the ability to render individual images via the message actions dropdown.
  1324. If you want to disallow users from doing so, set the ``allowed_image_domains`` option to an empty array ``[]``.
  1325. show_retraction_warning
  1326. -----------------------
  1327. * Default: ``true``
  1328. From `XEP-0424: Message Retraction <https://xmpp.org/extensions/xep-0424.html>`_:
  1329. ::
  1330. Due to the federated and extensible nature of XMPP it's not possible to remove a message with
  1331. full certainty and a retraction can only be considered an unenforceable request for such removal.
  1332. Clients which don't support message retraction are not obligated to enforce the request and
  1333. people could have seen or copied the message contents already.
  1334. By default Converse shows a warning to users when they retract a message, to
  1335. inform them that they don't have a guarantee that the message will be removed
  1336. everywhere.
  1337. This warning isn't applicable to all deployments of Converse and can therefore
  1338. be turned off by setting this config variable to ``false``.
  1339. show_send_button
  1340. ----------------
  1341. * Default: ``true``
  1342. Adds a button to the chat which can be clicked or tapped in order to send the
  1343. message.
  1344. show_tab_notifications
  1345. ----------------------
  1346. * Default: ``true``
  1347. Determines whether an unread messages counter is shown in the tab.
  1348. singleton
  1349. ---------
  1350. * Default: ``false``
  1351. If set to ``true``, then only one chat (one-on-one or groupchat) will be allowed.
  1352. The chat must be specified with the `auto_join_rooms`_ or `auto_join_private_chats`_ options.
  1353. This setting is useful together with `view_mode`_ set to ``embedded``, when you
  1354. want to embed a chat into the page.
  1355. Alternatively you could use it with `view_mode`_ set to ``overlayed`` to create
  1356. a single helpdesk-type chat.
  1357. smacks_max_unacked_stanzas
  1358. --------------------------
  1359. * Default: ``5``
  1360. This setting relates to `XEP-0198 <https://xmpp.org/extensions/xep-0198.html>`_
  1361. and determines the number of stanzas to be sent before Converse will ask the
  1362. server for acknowledgement of those stanzas.
  1363. sounds_path
  1364. -----------
  1365. * Default: ``${assets_path}/sounds/``
  1366. This option only makes sense in conjunction with the `play_sounds`_ option and
  1367. specifies the URL of the sound files to be played (exluding the file names
  1368. themselves).
  1369. In order to support all browsers we need both an MP3 and an Ogg file. Make sure
  1370. to name your files ``msg_received.ogg`` and ``msg_received.mp3``.
  1371. stanza_timeout
  1372. --------------
  1373. * Default: ``20000`` (20 seconds)
  1374. The time to wait, in milliseconds, for a response stanza (for example to an IQ
  1375. request), before a timeout error is thrown and Converse stops waiting.
  1376. sticky_controlbox
  1377. -----------------
  1378. * Default: ``false`` (``true`` when the ``view_mode`` is set to ``fullscreen``).
  1379. If set to ``true``, the control box (which includes the login, registration,
  1380. contacts and rooms tabs) will not be closeable. It won't have a close button at
  1381. all.
  1382. The idea behind this setting is to provide a better experience on mobile
  1383. devices when the intent is to use Converse as a web app. In this case
  1384. it doesn't make sense to close the control box, as there's often then nothing
  1385. "behind" it that's relevant to the user.
  1386. .. _`strict_plugin_dependencies`:
  1387. strict_plugin_dependencies
  1388. --------------------------
  1389. * Default: ``false``
  1390. When set to ``true`` and a plugin tries to override an object which doesn't
  1391. exist (for example because the plugin which provides that object is not
  1392. loaded), then an error will be raised.
  1393. Otherwise a message will simply be logged and the override instruction ignored.
  1394. The Converse plugins architecture can have an :ref:`dependencies`
  1395. plugin attribute. This enables you to specify an array of other plugins which
  1396. this one depends on.
  1397. Converse (more specifically, `pluggable.js <https://jcbrand.github.io/pluggable.js/>`_)
  1398. will first load these dependencies before executing the plugin's overrides and
  1399. calling its ``initialize`` method.
  1400. This is especially important if you register event handlers in your plugin for
  1401. events that fire in other plugins. In this case, you want to specify those
  1402. other plugins as dependencies.
  1403. If ``strict_plugin_dependencies`` is set to ``false``, an error won't be raised
  1404. if the optional dependencies aren't found.
  1405. synchronize_availability
  1406. ------------------------
  1407. * Default: ``true``
  1408. * Valid options: ``true``, ``false``, ``a resource name``.
  1409. This option lets you synchronize your chat status (`online`, `busy`, `away`) with other chat clients. In other words,
  1410. if you change your status to ``busy`` in a different chat client, your status will change to ``busy`` in Converse as well.
  1411. If set to ``true``, Converse will synchronize with all other clients you are logged in with.
  1412. If set to ``false``, this feature is disabled.
  1413. If set to ``a resource name``, Converse will synchronize only with a client that has that particular resource assigned to it.
  1414. .. _`theme`:
  1415. theme
  1416. -----
  1417. * Default: ``default``
  1418. * Valid options: ``default``, ``concord``, ``dracula``
  1419. Let's you set a color theme for Converse.
  1420. colorize_username
  1421. -------------------
  1422. * Default: ``false``
  1423. Wether nicknames should be colorized, in compliance with `XEP-0392: Consistent Color Generation <https://xmpp.org/extensions/xep-0392.html>`_.
  1424. time_format
  1425. -----------
  1426. * Default: ``HH:mm``
  1427. Examples: ``HH:mm``, ``hh:mm``, ``hh:mm a``.
  1428. This option makes the time format for the time shown, for each message, configurable. Converse uses `DayJS <https://github.com/iamkun/dayjs>`_
  1429. for showing time. This option allows the configuration of the format in which ``DayJS`` will display the time for the messages. For detailed
  1430. description of time-format options available for ``DayJS`` you can check the
  1431. `default formatting options <https://github.com/iamkun/dayjs/blob/dev/docs/en/API-reference.md#displaying>`_ and the
  1432. `advanced options <https://github.com/iamkun/dayjs/blob/master/docs/en/Plugin.md#advancedformat>`_.
  1433. use_system_emojis
  1434. -----------------
  1435. * Default: ``true``
  1436. Determines whether emojis should be rendered by the user's system.
  1437. Not all operating systems support (all) emojis. So alternatively you can let
  1438. Converse render the emojis with `Twemoji <https://twemoji.twitter.com/>`_.
  1439. See also `emoji_image_path`_.
  1440. visible_toolbar_buttons
  1441. -----------------------
  1442. * Default:
  1443. .. code-block:: javascript
  1444. {
  1445. call: false,
  1446. spoiler: false,
  1447. emoji: true,
  1448. toggle_occupants: true
  1449. }
  1450. Allows you to show or hide buttons on the chatboxes' toolbars.
  1451. * *call*:
  1452. Provides a button with a picture of a telephone on it.
  1453. When the call button is pressed, it will emit an event that can be used by a third-party library to initiate a call.
  1454. .. code-block:: javascript
  1455. converse.listen.on('callButtonClicked', function(data) {
  1456. console.log('Strophe connection is', data.connection);
  1457. console.log('Bare buddy JID is', data.model.get('jid'));
  1458. // ... Third-party library code ...
  1459. });
  1460. * *emoji*:
  1461. Enables rendering of emoji and provides a toolbar button for choosing them.
  1462. * *spoiler*:
  1463. Shows a button for showing`XEP-0382 <https://xmpp.org/extensions/xep-0382.html>`_ spoiler messages.
  1464. * *toggle_occupants*:
  1465. Shows a button for toggling (i.e. showing/hiding) the list of occupants in a chatroom.
  1466. .. _`websocket-url`:
  1467. websocket_url
  1468. -------------
  1469. * Default: ``undefined``
  1470. Example: ``ws://xmpp.example.com:5280/ws/``
  1471. Example with reverse-proxy and TLS: ``wss://xmpp.example.com/ws/``
  1472. This option is used to specify a
  1473. `websocket <https://developer.mozilla.org/en/docs/WebSockets>`_ URI to which
  1474. Converse can connect to.
  1475. Websockets provide a more modern and effective two-way communication protocol
  1476. between the browser and a server, effectively emulating TCP at the application
  1477. layer and therefore overcoming many of the problems with existing long-polling
  1478. techniques for bidirectional HTTP (such as `BOSH <https://en.wikipedia.org/wiki/BOSH>`_).
  1479. Please refer to your XMPP server's documentation on how to enable websocket
  1480. support.
  1481. .. _`view_mode`:
  1482. view_mode
  1483. ---------
  1484. * Default: ``overlayed``
  1485. * Allowed values: ``overlayed``, ``fullscreen``, ``mobile``, ``embedded``
  1486. The ``view_mode`` setting configures Converse's mode and resulting behavior.
  1487. * ``overlayed`` is the original mode, in which the chats appeared as small boxes overlaying a webpage which can contain arbitrary content.
  1488. * ``fullscreen`` is for a fullpage and single-page app.
  1489. * ``embedded`` is used to embed Converse into a particular part of the web page. Put the custom element ``<converse-root></converse-root>`` into your page HTML there were you want Converse to appear. See `conversejs.org/demo/embedded.html <https://conversejs.org/demo/embedded.html>`_ for an example of this view mode.
  1490. * ``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.
  1491. .. note::
  1492. Before the introduction of this setting (in version 3.3.0), there were there
  1493. different builds, each for the different modes.
  1494. These were:
  1495. * ``converse-mobile.js`` for the ``mobile`` mode
  1496. * ``converse-muc-embedded.js`` for embedding a single MUC room into a DOM element with id ``conversejs``
  1497. * ``converse.js`` for the ``overlayed`` mode
  1498. * ``inverse.js`` for the ``fullscreen`` mode
  1499. Besides having different builds, certain plugins had to be whitelisted
  1500. and blacklisted for the different modes.
  1501. ``converse-singleton`` had to be whitelisted for the ``mobile`` and ``fullscreen``
  1502. modes, additionally ``converse-inverse`` had to be whitelisted for the
  1503. ``fullscreen`` mode.
  1504. For both those modes the ``converse-minimize`` and ``converse-dragresize``
  1505. plugins had to be blacklisted.
  1506. When using ``converse-muc-embedded.js`` various plugins also had to manually be
  1507. blacklisted.
  1508. Since version 3.3.0 it's no longer necessary to blacklist any plugins (except
  1509. for ``converse-muc-embedded.js``, which is from version 3.3.3).
  1510. Blacklisting now happens automatically.
  1511. Since version 3.3.0, the ``inverse.js`` and ``converse-mobile.js`` builds no
  1512. longer exist. Instead the standard ``converse.js`` build is used, together with
  1513. the appropriate ``view_mode`` value.
  1514. Since version 4.0.0, there is now also only one CSS file to be used for all
  1515. the different view modes, ``converse.css``.
  1516. The ``converse-muc-embedded.js`` build can still be built, because it's smaller
  1517. than ``converse.js`` due to unused code being removed. It doesn't however contain
  1518. any new code, so the full ``converse.js`` build could be used instead, as long
  1519. as ``view_mode`` is set to ``embedded``.
  1520. Furthermore, it's no longer necessary to whitelist or blacklist any plugins
  1521. when switching view modes.
  1522. .. _`whitelisted_plugins`:
  1523. whitelisted_plugins
  1524. -------------------
  1525. * Default: ``[]``
  1526. A list of plugin names that are whitelisted and will therefore be
  1527. initialized once ``converse.initialize`` is called.
  1528. From Converse 3.0 onwards most of the API is available only to plugins and
  1529. all plugins need to be whitelisted first.
  1530. This is done to prevent malicious scripts from using the API to trick users or
  1531. to read their conversations.
  1532. By default all the core plugins are already whitelisted.
  1533. These are::
  1534. converse-bookmarks
  1535. converse-chatboxes
  1536. converse-chatview
  1537. converse-controlbox
  1538. converse-core
  1539. converse-disco
  1540. converse-dragresize
  1541. converse-fullscreen
  1542. converse-headline
  1543. converse-mam
  1544. converse-minimize
  1545. converse-muc
  1546. converse-muc-embedded
  1547. converse-notification
  1548. converse-ping
  1549. converse-profile
  1550. converse-register
  1551. converse-roomslist
  1552. converse-rosterview
  1553. converse-singleton
  1554. converse-spoilers
  1555. converse-vcard'
  1556. .. note::
  1557. If you are using a custom build which excludes some core plugins, then you
  1558. should blacklist them so that malicious scripts can't register their own
  1559. plugins under those names. See `blacklisted_plugins`_ for more info.
  1560. Example:
  1561. .. code-block:: javascript
  1562. require(['converse-core', 'converse-muc-embedded'], function (converse) {
  1563. converse.initialize({
  1564. // other settings removed for brevity
  1565. whitelisted_plugins: ['myplugin']
  1566. });
  1567. });
  1568. xhr_user_search_url
  1569. -------------------
  1570. .. note::
  1571. XHR stands for XMLHTTPRequest, and is meant here in the AJAX sense (Asynchronous JavaScript and XML).
  1572. * Default: ``null``
  1573. There are two ways to add users.
  1574. * The user inputs a valid JID (Jabber ID, aka XMPP address), and the user is added as a pending contact.
  1575. * The user inputs some text (for example part of a first name or last name),
  1576. an XHR (Ajax Request) will be made to a remote server, and a list of matches are returned.
  1577. The user can then choose one of the matches to add as a contact.
  1578. By providing an XHR search URL, you're enabling the second mechanism.
  1579. *What is expected from the remote server?*
  1580. A default JSON encoded list of objects must be returned. Each object
  1581. corresponds to a matched user and needs the keys ``jid`` and ``fullname``.
  1582. .. code-block:: javascript
  1583. [{"jid": "marty@mcfly.net", "fullname": "Marty McFly"}, {"jid": "doc@brown.com", "fullname": "Doc Brown"}]
  1584. .. note::
  1585. Make sure your server script sets the header `Content-Type: application/json`.
  1586. This is the URL to which an XHR GET request will be made to fetch user data from your remote server.
  1587. The query string will be included in the request with ``q`` as its key.
  1588. The data returned must be a JSON encoded list of user JIDs.
  1589. .. note::
  1590. Converse will construct the XHR get URL by simply appending
  1591. ``q=<query string entered>`` to the URL given by ``xhr_user_search_url``.
  1592. It is therefore important that the necessary question mark (``?``) preceding the
  1593. URL's query component or necessary delimiters (``&``) are included. See valid
  1594. examples below.
  1595. Examples:
  1596. .. code-block:: javascript
  1597. xhr_user_search_url: 'https://some.url/some_path?',
  1598. xhr_user_search_url: 'https://some.url/some_path?api_key=somekey&',