Mercurial > prosody-modules
comparison mod_archive/mod_archive.lua @ 632:dcb8e7d2c711
mod_archive: applied patch from stephen.weber@gswot.org to fix issue 6 and 7; need fully test.
| author | shinysky<shinysky1986(AT)gmail.com> |
|---|---|
| date | Thu, 29 Mar 2012 10:32:40 +0800 |
| parents | 6202ce4d12d6 |
| children | c1b0f0c33c6a 9bbd99f2057a |
comparison
equal
deleted
inserted
replaced
| 631:c9084b4c14f0 | 632:dcb8e7d2c711 |
|---|---|
| 758 local body = stanza:child_with_name("body"); | 758 local body = stanza:child_with_name("body"); |
| 759 local thread = stanza:child_with_name("thread"); | 759 local thread = stanza:child_with_name("thread"); |
| 760 if body then | 760 if body then |
| 761 local from_node, from_host = jid.split(stanza.attr.from); | 761 local from_node, from_host = jid.split(stanza.attr.from); |
| 762 local to_node, to_host = jid.split(stanza.attr.to); | 762 local to_node, to_host = jid.split(stanza.attr.to); |
| 763 if um.user_exists(from_node, from_host) and apply_pref(from_node, from_host, stanza.attr.to, thread) then | 763 if hosts[from_host] and um.user_exists(from_node, from_host) and apply_pref(from_node, from_host, stanza.attr.to, thread) then |
| 764 store_msg(stanza, from_node, from_host, true); | 764 store_msg(stanza, from_node, from_host, true); |
| 765 end | 765 end |
| 766 if um.user_exists(to_node, to_host) and apply_pref(to_node, to_host, stanza.attr.from, thread) then | 766 if hosts[to_host] and um.user_exists(to_node, to_host) and apply_pref(to_node, to_host, stanza.attr.from, thread) then |
| 767 store_msg(stanza, to_node, to_host, false); | 767 store_msg(stanza, to_node, to_host, false); |
| 768 end | 768 end |
| 769 end | 769 end |
| 770 | 770 |
| 771 return nil; | 771 return nil; |
| 785 -- Replication | 785 -- Replication |
| 786 module:hook("iq/self/urn:xmpp:archive:modified", modified_handler); | 786 module:hook("iq/self/urn:xmpp:archive:modified", modified_handler); |
| 787 | 787 |
| 788 module:hook("message/full", msg_handler, 10); | 788 module:hook("message/full", msg_handler, 10); |
| 789 module:hook("message/bare", msg_handler, 10); | 789 module:hook("message/bare", msg_handler, 10); |
| 790 module:hook("pre-message/full", msg_handler, 10); | |
| 791 module:hook("pre-message/bare", msg_handler, 10); | |
| 790 | 792 |
| 791 -- TODO exactmatch | 793 -- TODO exactmatch |
| 792 -- TODO <item/> JID match | 794 -- TODO <item/> JID match |
| 793 -- TODO 'open attr' in removing a collection | 795 -- TODO 'open attr' in removing a collection |
| 794 -- TODO save = body/message/stream | 796 -- TODO save = body/message/stream |
