diff options
author | Waqas Hussain <waqas20@gmail.com> | 2010-02-13 02:55:24 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2010-02-13 02:55:24 +0500 |
commit | a66f328e17994928d8eb26d6699e1e2d6fe4228b (patch) | |
tree | abd39449cf28ff825e4b49bb050a3bcf371ed3c2 /core | |
parent | f7573ef4ffe462e42ee63b4e002987662da4b379 (diff) | |
download | prosody-a66f328e17994928d8eb26d6699e1e2d6fe4228b.tar.gz prosody-a66f328e17994928d8eb26d6699e1e2d6fe4228b.zip |
stanza_router: Fire /self events for stanzas users send to their own bare JID.
Diffstat (limited to 'core')
-rw-r--r-- | core/stanza_router.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua index 12133a8e..71e40681 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -124,7 +124,7 @@ function core_post_stanza(origin, stanza, preevents) local node, host, resource = jid_split(to); local to_bare = node and (node.."@"..host) or host; -- bare JID - local to_type; + local to_type, to_self; if node then if resource then to_type = '/full'; @@ -132,6 +132,7 @@ function core_post_stanza(origin, stanza, preevents) to_type = '/bare'; if node == origin.username and host == origin.host then stanza.attr.to = nil; + to_self = true; end end else @@ -149,6 +150,7 @@ function core_post_stanza(origin, stanza, preevents) local h = hosts[to_bare] or hosts[host or origin.host]; if h then if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing + if to_self and h.events.fire_event(stanza.name..'/self', event_data) then return; end -- do processing if h.type == "component" then component_handle_stanza(origin, stanza); |