Comparison

mod_muc_limits/mod_muc_limits.lua @ 555:2356ad05fdb6

mod_muc_limits: Don't limit room leaving
author Matthew Wild <mwild1@gmail.com>
date Sun, 15 Jan 2012 01:36:11 +0000
parent 554:a2b0174b5c48
child 556:e50bdbaa7802
comparison
equal deleted inserted replaced
554:a2b0174b5c48 555:2356ad05fdb6
5 local period = math.max(module:get_option_number("muc_event_rate", 0.5), 0); 5 local period = math.max(module:get_option_number("muc_event_rate", 0.5), 0);
6 local burst = math.max(module:get_option_number("muc_burst_factor", 6), 1); 6 local burst = math.max(module:get_option_number("muc_burst_factor", 6), 1);
7 7
8 local function handle_stanza(event) 8 local function handle_stanza(event)
9 local origin, stanza = event.origin, event.stanza; 9 local origin, stanza = event.origin, event.stanza;
10 if stanza.name == "presence" and stanza.attr.type == "unavailable" then -- Don't limit room leaving
11 return;
12 end
10 local dest_room, dest_host, dest_nick = jid.split(stanza.attr.to); 13 local dest_room, dest_host, dest_nick = jid.split(stanza.attr.to);
11 local room = hosts[module.host].modules.muc.rooms[dest_room.."@"..dest_host]; 14 local room = hosts[module.host].modules.muc.rooms[dest_room.."@"..dest_host];
12 if not room then return; end 15 if not room then return; end
13 local from_jid = stanza.attr.from; 16 local from_jid = stanza.attr.from;
14 local occupant = room._occupants[room._jid_nick[from_jid]]; 17 local occupant = room._occupants[room._jid_nick[from_jid]];