Software /
code /
prosody
Comparison
plugins/mod_offline.lua @ 6834:750a97b45f88
mod_offline: Decrease priority of event handlers so 3rd party hooks fire first by default
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 16 Sep 2015 15:18:30 +0200 |
parent | 5776:bd0ff8ae98a8 |
child | 8024:8eec715c13a6 |
comparison
equal
deleted
inserted
replaced
6833:aeb088bb1a20 | 6834:750a97b45f88 |
---|---|
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, -1); |
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; |
37 | 37 |
38 local node, host = origin.username, origin.host; | 38 local node, host = origin.username, origin.host; |
46 stanza.attr.stamp, stanza.attr.stamp_legacy = nil, nil; | 46 stanza.attr.stamp, stanza.attr.stamp_legacy = nil, nil; |
47 origin.send(stanza); | 47 origin.send(stanza); |
48 end | 48 end |
49 datamanager.list_store(node, host, "offline", nil); | 49 datamanager.list_store(node, host, "offline", nil); |
50 return true; | 50 return true; |
51 end); | 51 end, -1); |