aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/util.lib.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2014-05-17 18:17:34 +0100
committerMatthew Wild <mwild1@gmail.com>2014-05-17 18:17:34 +0100
commit9680214e3d4d8d853e83bbdb357601673dd6f2f6 (patch)
tree2a26da46594280307909ffa18a10932d788e5666 /plugins/muc/util.lib.lua
parentc83e3a24ae55f509d17571a90f7397b1274808ff (diff)
parent21b4f0514bfd35fb7ec732d49d15a6cdff95a2ca (diff)
downloadprosody-9680214e3d4d8d853e83bbdb357601673dd6f2f6.tar.gz
prosody-9680214e3d4d8d853e83bbdb357601673dd6f2f6.zip
Merge with daurnimator
Diffstat (limited to 'plugins/muc/util.lib.lua')
-rw-r--r--plugins/muc/util.lib.lua44
1 files changed, 44 insertions, 0 deletions
diff --git a/plugins/muc/util.lib.lua b/plugins/muc/util.lib.lua
new file mode 100644
index 00000000..90a3a183
--- /dev/null
+++ b/plugins/muc/util.lib.lua
@@ -0,0 +1,44 @@
+-- Prosody IM
+-- Copyright (C) 2008-2010 Matthew Wild
+-- Copyright (C) 2008-2010 Waqas Hussain
+-- Copyright (C) 2014 Daurnimator
+--
+-- This project is MIT/X11 licensed. Please see the
+-- COPYING file in the source package for more information.
+--
+
+local _M = {};
+
+_M.valid_affiliations = {
+ outcast = -1;
+ none = 0;
+ member = 1;
+ admin = 2;
+ owner = 3;
+};
+
+_M.valid_roles = {
+ none = 0;
+ visitor = 1;
+ participant = 2;
+ moderator = 3;
+};
+
+local kickable_error_conditions = {
+ ["gone"] = true;
+ ["internal-server-error"] = true;
+ ["item-not-found"] = true;
+ ["jid-malformed"] = true;
+ ["recipient-unavailable"] = true;
+ ["redirect"] = true;
+ ["remote-server-not-found"] = true;
+ ["remote-server-timeout"] = true;
+ ["service-unavailable"] = true;
+ ["malformed error"] = true;
+};
+function _M.is_kickable_error(stanza)
+ local cond = select(2, stanza:get_error()) or "malformed error";
+ return kickable_error_conditions[cond];
+end
+
+return _M;