91 handle_stanza(session, stanza); |
91 handle_stanza(session, stanza); |
92 end |
92 end |
93 end |
93 end |
94 end |
94 end |
95 |
95 |
|
96 -- TODO: Does this function belong here? |
96 function is_authorized_to_see_presence(origin, username, host) |
97 function is_authorized_to_see_presence(origin, username, host) |
97 local roster = datamanager.load(username, host, "roster") or {}; |
98 local roster = datamanager.load(username, host, "roster") or {}; |
98 local item = roster[origin.username.."@"..origin.host]; |
99 local item = roster[origin.username.."@"..origin.host]; |
99 return item and (item.subscription == "both" or item.subscription == "from"); |
100 return item and (item.subscription == "both" or item.subscription == "from"); |
100 end |
101 end |