Software / code / prosody
Comparison
plugins/mod_carbons.lua @ 10782:6b776f80b96e
mod_carbons: Carbon anything that has been archived by the current user
This ensures rules in mod_mam apply to some extent. Messages worth
archiving are probably worth sending to other clients.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 26 Apr 2020 20:24:51 +0200 |
| parent | 10781:f7e8d299513f |
| child | 10785:e210afc9296a |
comparison
equal
deleted
inserted
replaced
| 10781:f7e8d299513f | 10782:6b776f80b96e |
|---|---|
| 43 return true, "type"; | 43 return true, "type"; |
| 44 end | 44 end |
| 45 | 45 |
| 46 if st_type == "error" and not c2s and not (stanza.attr.from or ""):find("/") then | 46 if st_type == "error" and not c2s and not (stanza.attr.from or ""):find("/") then |
| 47 return true, "bounce"; | 47 return true, "bounce"; |
| 48 end | |
| 49 | |
| 50 for archived in stanza:childtags("stanza-id", "urn:xmpp:sid:0") do | |
| 51 if archived and archived.attr.by == user_bare then | |
| 52 return true, "archived"; | |
| 53 end | |
| 48 end | 54 end |
| 49 | 55 |
| 50 return false, "default"; | 56 return false, "default"; |
| 51 end | 57 end |
| 52 | 58 |