Software /
code /
prosody
Comparison
plugins/mod_blocklist.lua @ 6971:96080d86bab8
mod_blocklist: Add comments describing some variables
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 06 Dec 2015 02:12:28 +0100 |
parent | 6970:cde7d14052f9 |
child | 6972:9e926e48cbf9 |
comparison
equal
deleted
inserted
replaced
6970:cde7d14052f9 | 6971:96080d86bab8 |
---|---|
114 -- Add or remove some jid(s) from the blocklist | 114 -- Add or remove some jid(s) from the blocklist |
115 -- We want this to be atomic and not do a partial update | 115 -- We want this to be atomic and not do a partial update |
116 local function edit_blocklist(event) | 116 local function edit_blocklist(event) |
117 local origin, stanza = event.origin, event.stanza; | 117 local origin, stanza = event.origin, event.stanza; |
118 local username = origin.username; | 118 local username = origin.username; |
119 local action = stanza.tags[1]; | 119 local action = stanza.tags[1]; -- "block" or "unblock" |
120 local new = {}; | 120 local new = {}; -- JIDs to block depending or unblock on action |
121 | 121 |
122 for item in action:childtags("item") do | 122 for item in action:childtags("item") do |
123 local jid = jid_prep(item.attr.jid); | 123 local jid = jid_prep(item.attr.jid); |
124 if not jid then | 124 if not jid then |
125 origin.send(st_error_reply(stanza, "modify", "jid-malformed")); | 125 origin.send(st_error_reply(stanza, "modify", "jid-malformed")); |