Mercurial > prosody-hg
comparison plugins/mod_offline.lua @ 6054:7a5ddbaf758d
Merge 0.9->0.10
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 02 Apr 2014 17:41:38 +0100 |
| parents | bd0ff8ae98a8 |
| children | 750a97b45f88 |
comparison
equal
deleted
inserted
replaced
| 6053:2f93a04564b2 | 6054:7a5ddbaf758d |
|---|---|
| 1 -- Prosody IM | 1 -- Prosody IM |
| 2 -- Copyright (C) 2008-2009 Matthew Wild | 2 -- Copyright (C) 2008-2009 Matthew Wild |
| 3 -- Copyright (C) 2008-2009 Waqas Hussain | 3 -- Copyright (C) 2008-2009 Waqas Hussain |
| 4 -- | 4 -- |
| 5 -- This project is MIT/X11 licensed. Please see the | 5 -- This project is MIT/X11 licensed. Please see the |
| 6 -- COPYING file in the source package for more information. | 6 -- COPYING file in the source package for more information. |
| 7 -- | 7 -- |
| 8 | 8 |
| 9 | 9 |
| 22 if to then | 22 if to then |
| 23 node, host = jid_split(to) | 23 node, host = jid_split(to) |
| 24 else | 24 else |
| 25 node, host = origin.username, origin.host; | 25 node, host = origin.username, origin.host; |
| 26 end | 26 end |
| 27 | 27 |
| 28 stanza.attr.stamp, stanza.attr.stamp_legacy = datetime.datetime(), datetime.legacy(); | 28 stanza.attr.stamp, stanza.attr.stamp_legacy = datetime.datetime(), datetime.legacy(); |
| 29 local result = datamanager.list_append(node, host, "offline", st.preserialize(stanza)); | 29 local result = datamanager.list_append(node, host, "offline", st.preserialize(stanza)); |
| 30 stanza.attr.stamp, stanza.attr.stamp_legacy = nil, nil; | 30 stanza.attr.stamp, stanza.attr.stamp_legacy = nil, nil; |
| 31 | 31 |
| 32 return result; | 32 return result; |
| 33 end); | 33 end); |
| 34 | 34 |
| 35 module:hook("message/offline/broadcast", function(event) | 35 module:hook("message/offline/broadcast", function(event) |
| 36 local origin = event.origin; | 36 local origin = event.origin; |
