Mercurial > prosody-hg
comparison plugins/muc/mod_muc.lua @ 4797:e239668aa6d2
Merge 0.9->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 29 Apr 2012 02:10:55 +0100 |
| parents | 875b90d5ce0f |
| children | d8b9fe5900a2 |
comparison
equal
deleted
inserted
replaced
| 4796:04a34287dc12 | 4797:e239668aa6d2 |
|---|---|
| 67 | 67 |
| 68 for jid in pairs(persistent_rooms) do | 68 for jid in pairs(persistent_rooms) do |
| 69 local node = jid_split(jid); | 69 local node = jid_split(jid); |
| 70 local data = datamanager.load(node, muc_host, "config") or {}; | 70 local data = datamanager.load(node, muc_host, "config") or {}; |
| 71 local room = muc_new_room(jid, { | 71 local room = muc_new_room(jid, { |
| 72 history_length = max_history_messages; | 72 max_history_length = max_history_messages; |
| 73 }); | 73 }); |
| 74 room._data = data._data; | 74 room._data = data._data; |
| 75 room._data.history_length = max_history_messages; --TODO: Need to allow per-room with a global limit | 75 room._data.max_history_length = max_history_messages; -- Overwrite old max_history_length in data with current settings |
| 76 room._affiliations = data._affiliations; | 76 room._affiliations = data._affiliations; |
| 77 room.route_stanza = room_route_stanza; | 77 room.route_stanza = room_route_stanza; |
| 78 room.save = room_save; | 78 room.save = room_save; |
| 79 rooms[jid] = room; | 79 rooms[jid] = room; |
| 80 end | 80 end |
| 81 | 81 |
| 82 local host_room = muc_new_room(muc_host, { | 82 local host_room = muc_new_room(muc_host, { |
| 83 history_length = max_history_messages; | 83 max_history_length = max_history_messages; |
| 84 }); | 84 }); |
| 85 host_room.route_stanza = room_route_stanza; | 85 host_room.route_stanza = room_route_stanza; |
| 86 host_room.save = room_save; | 86 host_room.save = room_save; |
| 87 | 87 |
| 88 local function get_disco_info(stanza) | 88 local function get_disco_info(stanza) |
| 129 if not room then | 129 if not room then |
| 130 if not(restrict_room_creation) or | 130 if not(restrict_room_creation) or |
| 131 (restrict_room_creation == "admin" and is_admin(stanza.attr.from)) or | 131 (restrict_room_creation == "admin" and is_admin(stanza.attr.from)) or |
| 132 (restrict_room_creation == "local" and select(2, jid_split(stanza.attr.from)) == module.host:gsub("^[^%.]+%.", "")) then | 132 (restrict_room_creation == "local" and select(2, jid_split(stanza.attr.from)) == module.host:gsub("^[^%.]+%.", "")) then |
| 133 room = muc_new_room(bare, { | 133 room = muc_new_room(bare, { |
| 134 history_length = max_history_messages; | 134 max_history_length = max_history_messages; |
| 135 }); | 135 }); |
| 136 room.route_stanza = room_route_stanza; | 136 room.route_stanza = room_route_stanza; |
| 137 room.save = room_save; | 137 room.save = room_save; |
| 138 rooms[bare] = room; | 138 rooms[bare] = room; |
| 139 end | 139 end |
