Mercurial > prosody-modules
comparison mod_archive/mod_archive.lua @ 222:6e6a08b0531a
mod_archive: minor fix.
author | shinysky<shinysky1986(AT)gmail.com> |
---|---|
date | Sun, 25 Jul 2010 18:18:26 +0800 |
parents | 1861290055c0 |
children | de71a52fc63a |
comparison
equal
deleted
inserted
replaced
221:1861290055c0 | 222:6e6a08b0531a |
---|---|
15 local xmlns_rsm = "http://jabber.org/protocol/rsm"; | 15 local xmlns_rsm = "http://jabber.org/protocol/rsm"; |
16 local DEFAULT_MAX = 100; | 16 local DEFAULT_MAX = 100; |
17 | 17 |
18 local FORCE_ARCHIVING = false; | 18 local FORCE_ARCHIVING = false; |
19 local AUTO_ARCHIVING_ENABLED = true; | 19 local AUTO_ARCHIVING_ENABLED = true; |
20 | |
21 local HOST = 'localhost'; | |
20 | 22 |
21 module:add_feature("urn:xmpp:archive"); | 23 module:add_feature("urn:xmpp:archive"); |
22 module:add_feature("urn:xmpp:archive:auto"); | 24 module:add_feature("urn:xmpp:archive:auto"); |
23 module:add_feature("urn:xmpp:archive:manage"); | 25 module:add_feature("urn:xmpp:archive:manage"); |
24 module:add_feature("urn:xmpp:archive:manual"); | 26 module:add_feature("urn:xmpp:archive:manual"); |
694 local thread = stanza:child_with_name("thread"); | 696 local thread = stanza:child_with_name("thread"); |
695 if body then | 697 if body then |
696 local from_node, from_host = jid.split(stanza.attr.from); | 698 local from_node, from_host = jid.split(stanza.attr.from); |
697 local to_node, to_host = jid.split(stanza.attr.to); | 699 local to_node, to_host = jid.split(stanza.attr.to); |
698 -- FIXME only archive messages of users on this host | 700 -- FIXME only archive messages of users on this host |
699 if from_host == "localhost" and apply_pref(from_node, from_host, stanza.attr.to, thread) then | 701 if from_host == HOST and apply_pref(from_node, from_host, stanza.attr.to, thread) then |
700 store_msg(stanza, from_node, from_host, true); | 702 store_msg(stanza, from_node, from_host, true); |
701 end | 703 end |
702 if to_host == "localhost" and apply_pref(to_node, to_host, stanza.attr.from, thread) then | 704 if to_host == HOST and apply_pref(to_node, to_host, stanza.attr.from, thread) then |
703 store_msg(stanza, to_node, to_host, false); | 705 store_msg(stanza, to_node, to_host, false); |
704 end | 706 end |
705 end | 707 end |
706 | 708 |
707 return nil; | 709 return nil; |