Mercurial > prosody-modules
annotate mod_muc_mam_hints/mod_muc_mam_hints.lua @ 5511:0860497152af
mod_http_oauth2: Record hash of client_id to allow future verification
RFC 6819 section 5.2.2.2 states that refresh tokens MUST be bound to the
client. In order to do that, we must record something that can
definitely tie the client to the grant. Since the full client_id is so
large (why we have this client_subset function), a hash is stored
instead.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 02 Jun 2023 10:14:16 +0200 |
parents | 2aaf93d2b219 |
children |
rev | line source |
---|---|
3463
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
1 -- |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
2 -- A module to indicate if a MUC message qualifies as historic based on XEP-0334 hints |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
3 -- |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
4 |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
5 module:depends"muc_mam" |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
6 |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
7 module:log("debug", "Module loaded"); |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
8 |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
9 module:hook("muc-message-is-historic", function (event) |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
10 if (event.stanza:get_child("no-store", "urn:xmpp:hints") or |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
11 event.stanza:get_child("no-permanent-store", "urn:xmpp:hints")) then |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
12 module:log("debug", "Not archiving stanza: %s (urn:xmpp:hints)", event.stanza) |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
13 return false |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
14 elseif event.stanza:get_child("store", "urn:xmpp:hints") then |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
15 return true |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
16 else |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
17 return nil |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
18 end |
2aaf93d2b219
mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages
marc0s <marcos@tenak.net>
parents:
diff
changeset
|
19 end) |