Software /
code /
prosody
Comparison
plugins/mod_privacy.lua @ 1293:13dde33d5b87
mod_privacy: Initial commit
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 03 Jun 2009 08:02:24 +0500 |
child | 1522:569d58d21612 |
comparison
equal
deleted
inserted
replaced
1292:b18c1ad7fcb6 | 1293:13dde33d5b87 |
---|---|
1 | |
2 local st = require "util.stanza"; | |
3 local datamanager = require "util.datamanager"; | |
4 | |
5 module:hook("iq/bare/jabber:iq:privacy:query", function(data) | |
6 local origin, stanza = data.origin, data.stanza; | |
7 | |
8 if not stanza.attr.to then -- only service requests to own bare JID | |
9 local query = stanza.tags[1]; -- the query element | |
10 local privacy_lists = datamanager.load(origin.username, origin.host, "privacy") or {}; | |
11 if stanza.attr.type == "set" then | |
12 -- TODO | |
13 elseif stanza.attr.type == "get" then | |
14 if #query.tags == 0 then -- Client requests names of privacy lists from server | |
15 -- TODO | |
16 elseif #query.tags == 1 and query.tags[1].name == "list" then -- Client requests a privacy list from server | |
17 -- TODO | |
18 else | |
19 origin.send(st.error_reply(stanza, "modify", "bad-request")); | |
20 end | |
21 end | |
22 end | |
23 end); |