Software / code / prosody
Comparison
plugins/muc/description.lib.lua @ 7353:ca31d3271cf8
MUC: Save room to storage once after form processing, not in each individual setter
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 15 Apr 2016 11:50:55 +0200 |
| parent | 7352:50b24b3476e6 |
| child | 7401:e16b3fd0bd80 |
comparison
equal
deleted
inserted
replaced
| 7352:50b24b3476e6 | 7353:ca31d3271cf8 |
|---|---|
| 13 | 13 |
| 14 local function set_description(room, description) | 14 local function set_description(room, description) |
| 15 if description == "" then description = nil; end | 15 if description == "" then description = nil; end |
| 16 if get_description(room) == description then return false; end | 16 if get_description(room) == description then return false; end |
| 17 room._data.description = description; | 17 room._data.description = description; |
| 18 room:save(true); | |
| 19 return true; | 18 return true; |
| 20 end | 19 end |
| 21 | 20 |
| 22 local function add_form_option(event) | 21 local function add_form_option(event) |
| 23 table.insert(event.form, { | 22 table.insert(event.form, { |