Software /
code /
prosody
Changeset
5747:23076ee191d3
rostermanager, mod_groups: Change roster-load event to pass an event table for consistency
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 15 Jul 2013 11:43:23 +0100 (2013-07-15) |
parents | 5746:3137751751b4 |
children | 5748:cef2a1122b43 |
files | core/rostermanager.lua plugins/mod_groups.lua |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/core/rostermanager.lua Sat Jul 13 13:17:53 2013 +0100 +++ b/core/rostermanager.lua Mon Jul 15 11:43:23 2013 +0100 @@ -100,7 +100,7 @@ log("warn", "roster for %s has a self-contact", jid); end if not err then - hosts[host].events.fire_event("roster-load", username, host, roster); + hosts[host].events.fire_event("roster-load", { username = username, host = host, roster = roster }); end return roster, err; end
--- a/plugins/mod_groups.lua Sat Jul 13 13:17:53 2013 +0100 +++ b/plugins/mod_groups.lua Mon Jul 15 11:43:23 2013 +0100 @@ -17,11 +17,13 @@ local module_host = module:get_host(); -function inject_roster_contacts(username, host, roster) +function inject_roster_contacts(event) + local username, host= event.username, event.host; --module:log("debug", "Injecting group members to roster"); local bare_jid = username.."@"..host; if not members[bare_jid] and not members[false] then return; end -- Not a member of any groups + local roster = event.roster; local function import_jids_to_roster(group_name) for jid in pairs(groups[group_name]) do -- Add them to roster