Software /
code /
prosody
Comparison
plugins/muc/password.lib.lua @ 7352:50b24b3476e6
MUC: Provide a noop stub room:save() method
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 14 Apr 2016 21:23:09 +0200 |
parent | 6991:84e01dbb739e |
child | 7353:ca31d3271cf8 |
comparison
equal
deleted
inserted
replaced
7350:24e2369b67f9 | 7352:50b24b3476e6 |
---|---|
15 | 15 |
16 local function set_password(room, password) | 16 local function set_password(room, password) |
17 if password == "" then password = nil; end | 17 if password == "" then password = nil; end |
18 if room._data.password == password then return false; end | 18 if room._data.password == password then return false; end |
19 room._data.password = password; | 19 room._data.password = password; |
20 if room.save then room:save(true); end | 20 room:save(true); |
21 return true; | 21 return true; |
22 end | 22 end |
23 | 23 |
24 module:hook("muc-disco#info", function(event) | 24 module:hook("muc-disco#info", function(event) |
25 event.reply:tag("feature", {var = get_password(event.room) and "muc_passwordprotected" or "muc_unsecured"}):up(); | 25 event.reply:tag("feature", {var = get_password(event.room) and "muc_passwordprotected" or "muc_unsecured"}):up(); |