Software / code / prosody
Comparison
plugins/muc/name.lib.lua @ 11120:b2331f3dfeea
Merge 0.11->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 30 Sep 2020 09:50:33 +0100 |
| parent | 11057:13eee48071c8 |
comparison
equal
deleted
inserted
replaced
| 11119:68df52bf08d5 | 11120:b2331f3dfeea |
|---|---|
| 5 -- | 5 -- |
| 6 -- This project is MIT/X11 licensed. Please see the | 6 -- This project is MIT/X11 licensed. Please see the |
| 7 -- COPYING file in the source package for more information. | 7 -- COPYING file in the source package for more information. |
| 8 -- | 8 -- |
| 9 | 9 |
| 10 local jid_split = require "util.jid".split; | |
| 11 | |
| 12 local function get_name(room) | 10 local function get_name(room) |
| 13 return room._data.name or jid_split(room.jid); | 11 return room._data.name; |
| 14 end | 12 end |
| 15 | 13 |
| 16 local function set_name(room, name) | 14 local function set_name(room, name) |
| 17 if name == "" then name = nil; end | 15 if name == "" then name = nil; end |
| 18 if room._data.name == name then return false; end | 16 if room._data.name == name then return false; end |