Software /
code /
prosody
Annotate
plugins/mod_privacy.lua @ 3040:c02d0e7e088e
mod_bosh: Remove some hacky code for pruning dead requests that hopefully never gets executed - if it does there's a bug anyway.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 17 May 2010 11:45:11 +0100 |
parent | 2923:b7049746bd29 |
child | 2925:692b3c6c5bd2 |
rev | line source |
---|---|
1522
569d58d21612
Add copyright header to those files missing one
Matthew Wild <mwild1@gmail.com>
parents:
1293
diff
changeset
|
1 -- Prosody IM |
2923
b7049746bd29
Update copyright headers for 2010
Matthew Wild <mwild1@gmail.com>
parents:
1522
diff
changeset
|
2 -- Copyright (C) 2008-2010 Matthew Wild |
b7049746bd29
Update copyright headers for 2010
Matthew Wild <mwild1@gmail.com>
parents:
1522
diff
changeset
|
3 -- Copyright (C) 2008-2010 Waqas Hussain |
1522
569d58d21612
Add copyright header to those files missing one
Matthew Wild <mwild1@gmail.com>
parents:
1293
diff
changeset
|
4 -- |
569d58d21612
Add copyright header to those files missing one
Matthew Wild <mwild1@gmail.com>
parents:
1293
diff
changeset
|
5 -- This project is MIT/X11 licensed. Please see the |
569d58d21612
Add copyright header to those files missing one
Matthew Wild <mwild1@gmail.com>
parents:
1293
diff
changeset
|
6 -- COPYING file in the source package for more information. |
569d58d21612
Add copyright header to those files missing one
Matthew Wild <mwild1@gmail.com>
parents:
1293
diff
changeset
|
7 -- |
569d58d21612
Add copyright header to those files missing one
Matthew Wild <mwild1@gmail.com>
parents:
1293
diff
changeset
|
8 |
1293 | 9 |
10 local st = require "util.stanza"; | |
11 local datamanager = require "util.datamanager"; | |
12 | |
13 module:hook("iq/bare/jabber:iq:privacy:query", function(data) | |
14 local origin, stanza = data.origin, data.stanza; | |
15 | |
16 if not stanza.attr.to then -- only service requests to own bare JID | |
17 local query = stanza.tags[1]; -- the query element | |
18 local privacy_lists = datamanager.load(origin.username, origin.host, "privacy") or {}; | |
19 if stanza.attr.type == "set" then | |
20 -- TODO | |
21 elseif stanza.attr.type == "get" then | |
22 if #query.tags == 0 then -- Client requests names of privacy lists from server | |
23 -- TODO | |
24 elseif #query.tags == 1 and query.tags[1].name == "list" then -- Client requests a privacy list from server | |
25 -- TODO | |
26 else | |
27 origin.send(st.error_reply(stanza, "modify", "bad-request")); | |
28 end | |
29 end | |
30 end | |
31 end); |