From afdc9b9527eb409da2b7cef45b8d45ddf15d80b2 Mon Sep 17 00:00:00 2001 From: Badlop Date: Sun, 23 Dec 2007 12:28:44 +0000 Subject: [PATCH] * src/mod_muc/mod_muc_room.erl: Log room creation and destruction. Ensure JID of owners of MUC room are user, not server (EJAB-435) SVN Revision: 1104 --- ChangeLog | 6 ++++++ src/mod_muc/mod_muc_room.erl | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b21e9b70f..d2d970c82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-12-23 Badlop + + * src/mod_muc/mod_muc_room.erl: Log room creation and + destruction. Ensure JID of owners of MUC room are user, not + server (EJAB-435) + 2007-12-22 Badlop * src/ejabberd.app: Update ejabberd.app: add new erlang diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl index 282b212ee..ae4c2b912 100644 --- a/src/mod_muc/mod_muc_room.erl +++ b/src/mod_muc/mod_muc_room.erl @@ -159,6 +159,8 @@ init([Host, ServerHost, Access, Room, HistorySize, RoomShaper, Creator, _Nick, D just_created = true, room_shaper = Shaper}), State1 = set_opts(DefRoomOpts, State), + ?INFO_MSG("Created MUC room ~s@~s by ~s", + [Room, Host, jlib:jid_to_string(Creator)]), {ok, normal_state, State1}; init([Host, ServerHost, Access, Room, HistorySize, RoomShaper, Opts]) -> Shaper = shaper:new(RoomShaper), @@ -1930,13 +1932,18 @@ process_admin_items_set(UJID, Items, Lang, StateData) -> URole = get_role(UJID, StateData), case find_changed_items(UJID, UAffiliation, URole, Items, Lang, StateData, []) of {result, Res} -> - ?INFO_MSG("Processing MUC admin query from ~s:~n ~p~n", - [jlib:jid_to_string(UJID), Res]), + ?INFO_MSG("Processing MUC admin query from ~s in room ~s:~n ~p", + [jlib:jid_to_string(UJID), jlib:jid_to_string(StateData#state.jid), Res]), NSD = lists:foldl( fun(E, SD) -> case catch ( case E of + {JID, affiliation, owner, _} + when (JID#jid.luser == "") -> + %% If the provided JID does not have username, + %% forget the affiliation completely + SD; {JID, role, none, Reason} -> catch send_kickban_presence( JID, Reason, "307", SD), @@ -2388,6 +2395,8 @@ process_iq_owner(From, set, Lang, SubEl, StateData) -> {error, ?ERR_BAD_REQUEST} end; [{xmlelement, "destroy", _Attrs1, _Els1} = SubEl1] -> + ?INFO_MSG("Destroyed MUC room ~s by ~s", + [jlib:jid_to_string(StateData#state.jid), jlib:jid_to_string(From)]), destroy_room(SubEl1, StateData); Items -> process_admin_items_set(From, Items, Lang, StateData)