mod_presence, mod_offline: Merge message/offline/delete with message/offline/broadcast.
authorRobert Hoelz <rob@hoelz.ro>
Thu, 9 Dec 2010 18:28:05 +0000 (12:28 -0600)
committerRobert Hoelz <rob@hoelz.ro>
Thu, 9 Dec 2010 18:28:05 +0000 (12:28 -0600)
plugins/mod_offline.lua
plugins/mod_presence.lua

index a3ca21d0ebab2f58d5a963075b428effa488c5d1..f44d16af2657b63c768cb7f86f8320ff00a736be 100644 (file)
@@ -47,13 +47,7 @@ module:hook("message/offline/broadcast", function(event)
                        stanza.attr.stamp, stanza.attr.stamp_legacy = nil, nil;
                        origin.send(stanza);
                end
+               datamanager.list_store(node, host, "offline", nil);
                return true;
        end
 end);
-
-module:hook("message/offline/delete", function(event)
-       local origin = event.origin;
-       local node, host = origin.username, origin.host;
-
-       return datamanager.list_store(node, host, "offline", nil);
-end);
index 933aac622cca123aeb5bbbd43709e4a9767adccd..61239c9ac5b48bc7db84f598acf99c52ac7b9db0 100644 (file)
@@ -117,7 +117,6 @@ function handle_normal_presence(origin, stanza)
                if priority >= 0 then
                         local event = { origin = origin }
                         module:fire_event('message/offline/broadcast', event);
-                        module:fire_event('message/offline/delete', event);
                end
        end
        if stanza.attr.type == "unavailable" then