[ejabberd] how to disable join/leave/status messages in mod_muc_log

Badlop badlop at gmail.com
Tue May 4 12:47:08 MSD 2010


2010/5/2 sofia cardita <sofiacardita at gmail.com>:
> Is there anyway to disable the showing of join/leave & status messages in
> mod_muc_log logs?

Not configurable, but you can make a simple change in the code.
For example, this patch removes most of the logging,
and adds a default behavior of not logging:


--- a/src/mod_muc/mod_muc_log.erl
+++ b/src/mod_muc/mod_muc_log.erl
@@ -219,30 +219,8 @@ add_to_log2(text, {Nick, Packet}, Room, Opts, State) ->
            add_message_to_log(Nick, Message, Room, Opts, State)
     end;

-add_to_log2(roomconfig_change, _Occupants, Room, Opts, State) ->
-    add_message_to_log("", roomconfig_change, Room, Opts, State);
-
-add_to_log2(roomconfig_change_enabledlogging, Occupants, Room, Opts, State) ->
-    add_message_to_log("", {roomconfig_change, Occupants}, Room, Opts, State);
-
-add_to_log2(room_existence, NewStatus, Room, Opts, State) ->
-    add_message_to_log("", {room_existence, NewStatus}, Room, Opts, State);
-
-add_to_log2(nickchange, {OldNick, NewNick}, Room, Opts, State) ->
-    add_message_to_log(NewNick, {nickchange, OldNick}, Room, Opts, State);
-
-add_to_log2(join, Nick, Room, Opts, State) ->
-    add_message_to_log(Nick, join, Room, Opts, State);
-
-add_to_log2(leave, {Nick, Reason}, Room, Opts, State) ->
-    case Reason of
-       "" -> add_message_to_log(Nick, leave, Room, Opts, State);
-       _ -> add_message_to_log(Nick, {leave, Reason}, Room, Opts, State)
-    end;
-
-add_to_log2(kickban, {Nick, Reason, Code}, Room, Opts, State) ->
-    add_message_to_log(Nick, {kickban, Code, Reason}, Room, Opts, State).
-
+add_to_log2(_, _, _Room, _Opts, _State) ->
+    ok.

 %%----------------------------------------------------------------------
 %% Core



---
Badlop
ProcessOne


More information about the ejabberd mailing list