Mercurial > prosody-modules
annotate mod_compat_bind/mod_compat_bind.lua @ 4047:36b6e3e3f9e2
mod_conversejs: Disable automatic BOSH/WS endpoint discovery
Converse.js 7.0 will enable this by default, but when using this module
the BOSH and WebSocket endpoints are provided in the generated HTML, so
automatic discovery is not needed and unlikely to work without an
additional module.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 18 Jun 2020 15:24:34 +0200 |
parents | 73fbfd1e820b |
children |
rev | line source |
---|---|
748
f25b6a9f97bb
mod_compat_bind: Compatibility (ugh) with clients that send the resource bind to the login host (ugh)
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 -- Compatibility with clients that set 'to' on resource bind requests |
f25b6a9f97bb
mod_compat_bind: Compatibility (ugh) with clients that send the resource bind to the login host (ugh)
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 -- |
f25b6a9f97bb
mod_compat_bind: Compatibility (ugh) with clients that send the resource bind to the login host (ugh)
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 -- http://xmpp.org/rfcs/rfc3920.html#bind |
f25b6a9f97bb
mod_compat_bind: Compatibility (ugh) with clients that send the resource bind to the login host (ugh)
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 -- http://xmpp.org/rfcs/rfc6120.html#bind-servergen-success |
f25b6a9f97bb
mod_compat_bind: Compatibility (ugh) with clients that send the resource bind to the login host (ugh)
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
5 |
f25b6a9f97bb
mod_compat_bind: Compatibility (ugh) with clients that send the resource bind to the login host (ugh)
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 local st = require "util.stanza"; |
f25b6a9f97bb
mod_compat_bind: Compatibility (ugh) with clients that send the resource bind to the login host (ugh)
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 |
f25b6a9f97bb
mod_compat_bind: Compatibility (ugh) with clients that send the resource bind to the login host (ugh)
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 module:hook("iq/host/urn:ietf:params:xml:ns:xmpp-bind:bind", function(event) |
f25b6a9f97bb
mod_compat_bind: Compatibility (ugh) with clients that send the resource bind to the login host (ugh)
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 local fixed_stanza = st.clone(event.stanza); |
f25b6a9f97bb
mod_compat_bind: Compatibility (ugh) with clients that send the resource bind to the login host (ugh)
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 fixed_stanza.attr.to = nil; |
2322
73fbfd1e820b
mod_compat_bind: Use non-deprecated way to access core_process_stanza (thanks Roi)
Kim Alvefur <zash@zash.se>
parents:
748
diff
changeset
|
11 prosody.core_process_stanza(event.origin, fixed_stanza); |
748
f25b6a9f97bb
mod_compat_bind: Compatibility (ugh) with clients that send the resource bind to the login host (ugh)
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 return true; |
f25b6a9f97bb
mod_compat_bind: Compatibility (ugh) with clients that send the resource bind to the login host (ugh)
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 end); |