Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 5519:06e188268df1
MUC: add __tostring on room metatable
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 25 Apr 2013 20:36:55 +0100 |
| parents | ed55a48270be |
| children | 1997671d5e46 |
comparison
equal
deleted
inserted
replaced
| 5518:0220093e34fa | 5519:06e188268df1 |
|---|---|
| 85 local function getText(stanza, path) return getUsingPath(stanza, path, true); end | 85 local function getText(stanza, path) return getUsingPath(stanza, path, true); end |
| 86 ----------- | 86 ----------- |
| 87 | 87 |
| 88 local room_mt = {}; | 88 local room_mt = {}; |
| 89 room_mt.__index = room_mt; | 89 room_mt.__index = room_mt; |
| 90 | |
| 91 function room_mt:__tostring() | |
| 92 return "MUC room ("..self.jid..")"; | |
| 93 end | |
| 90 | 94 |
| 91 function room_mt:get_default_role(affiliation) | 95 function room_mt:get_default_role(affiliation) |
| 92 if affiliation == "owner" or affiliation == "admin" then | 96 if affiliation == "owner" or affiliation == "admin" then |
| 93 return "moderator"; | 97 return "moderator"; |
| 94 elseif affiliation == "member" then | 98 elseif affiliation == "member" then |
