25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-02 16:37:52 +01:00

Merge changeset 1305 from ejabberd trunk.

2008-04-27  Alexey Shchepin  <alexey@process-one.net>

* src/mod_muc/mod_muc_room.erl: Fixed room shaper processing

SVN Revision: 1309
This commit is contained in:
Badlop 2008-04-28 18:44:28 +00:00
parent 6e5aaadf57
commit 2c795957ac
2 changed files with 24 additions and 24 deletions

View File

@ -2,6 +2,10 @@
* doc/guide.tex: Document the option max_s2s_connections * doc/guide.tex: Document the option max_s2s_connections
2008-04-27 Alexey Shchepin <alexey@process-one.net>
* src/mod_muc/mod_muc_room.erl: Fixed room shaper processing
2008-04-26 Badlop <badlop@process-one.net> 2008-04-26 Badlop <badlop@process-one.net>
* src/mod_shared_roster.erl: Fix for new registered accounts not * src/mod_shared_roster.erl: Fix for new registered accounts not

View File

@ -697,31 +697,27 @@ code_change(_OldVsn, StateName, StateData, _Extra) ->
%% {stop, Reason, NewStateData} %% {stop, Reason, NewStateData}
%%---------------------------------------------------------------------- %%----------------------------------------------------------------------
handle_info({process_user_presence, From}, normal_state = _StateName, StateData) -> handle_info({process_user_presence, From}, normal_state = _StateName, StateData) ->
Activity = get_user_activity(From, StateData), RoomQueueEmpty = queue:is_empty(StateData#state.room_queue),
Now = now_to_usec(now()), RoomQueue = queue:in({presence, From}, StateData#state.room_queue),
{Nick, Packet} = Activity#activity.presence, StateData1 = StateData#state{room_queue = RoomQueue},
NewActivity = Activity#activity{presence_time = Now, if
presence = undefined}, RoomQueueEmpty ->
StateData1 = StateData2 = prepare_room_queue(StateData1),
StateData#state{ {next_state, normal_state, StateData2};
activity = ?DICT:store( true ->
jlib:jid_tolower(From), {next_state, normal_state, StateData1}
NewActivity, end;
StateData#state.activity)},
process_presence(From, Nick, Packet, StateData1);
handle_info({process_user_message, From}, normal_state = _StateName, StateData) -> handle_info({process_user_message, From}, normal_state = _StateName, StateData) ->
Activity = get_user_activity(From, StateData), RoomQueueEmpty = queue:is_empty(StateData#state.room_queue),
Now = now_to_usec(now()), RoomQueue = queue:in({message, From}, StateData#state.room_queue),
Packet = Activity#activity.message, StateData1 = StateData#state{room_queue = RoomQueue},
NewActivity = Activity#activity{message_time = Now, if
message = undefined}, RoomQueueEmpty ->
StateData1 = StateData2 = prepare_room_queue(StateData1),
StateData#state{ {next_state, normal_state, StateData2};
activity = ?DICT:store( true ->
jlib:jid_tolower(From), {next_state, normal_state, StateData1}
NewActivity, end;
StateData#state.activity)},
process_groupchat_message(From, Packet, StateData1);
handle_info(process_room_queue, normal_state = StateName, StateData) -> handle_info(process_room_queue, normal_state = StateName, StateData) ->
case queue:out(StateData#state.room_queue) of case queue:out(StateData#state.room_queue) of
{{value, {message, From}}, RoomQueue} -> {{value, {message, From}}, RoomQueue} ->