Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3069 | Rev 3077 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3069 Rev 3076
Línea 8... Línea 8...
8
export function Chat() {
8
export function Chat() {
9
  const {
9
  const {
10
    xmpp_hostname,
10
    xmpp_hostname,
11
    xmpp_username,
11
    xmpp_username,
12
    xmpp_password,
12
    xmpp_password,
13
    xmpp_domain,
13
    xmpp_domain
14
    xmpp_port
14
    // xmpp_port
15
  } = useSelector((state) => state.auth)
15
  } = useSelector((state) => state.auth)
16
  const isAuth = useSelector((state) => state.auth.isAuth)
16
  const isAuth = useSelector((state) => state.auth.isAuth)
Línea 17... Línea 17...
17
 
17
 
18
  useLayoutEffect(() => {
18
  useLayoutEffect(() => {
19
    if (!xmpp_hostname || !xmpp_username || !xmpp_password || !xmpp_domain)
19
    if (!xmpp_hostname || !xmpp_username || !xmpp_password || !xmpp_domain)
Línea 20... Línea 20...
20
      return
20
      return
Línea 21... Línea 21...
21
 
21
 
22
    const converse = window.converse
22
    const converse = window.converse
23
 
-
 
24
    converse.initialize({
-
 
25
      bosh_service_url: `https://${xmpp_hostname}:${
23
 
26
        17443 ?? xmpp_port
24
    converse.initialize({
27
      }/http-bind/`,
25
      bosh_service_url: `https://${xmpp_hostname}:${17443}/http-bind/`,
28
      authentication: 'login',
26
      authentication: 'login',
29
      jid: `${xmpp_username}@${xmpp_domain}.com`,
27
      jid: `${xmpp_username}@${xmpp_domain}.com`,
Línea 34... Línea 32...
34
      allow_logout: false,
32
      allow_logout: false,
35
      auto_login: true,
33
      auto_login: true,
36
      auto_reconnect: true,
34
      auto_reconnect: true,
37
      debug: false,
35
      debug: false,
38
      view_mode: 'overlayed',
36
      view_mode: 'overlayed',
39
      i18n: 'es',
37
      i18n: 'es'
40
      assets_path: '/public/'
-
 
41
    })
38
    })
Línea 42... Línea 39...
42
 
39
 
43
    return () => {
40
    return () => {
44
      converse.connection?.disconnect()
41
      converse.connection?.disconnect()