diff --git a/ChangeLog b/ChangeLog index 6c09ce86f..79df3eb5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ * src/mod_echo.erl: Fix call to exmpp_xml:get_cdata_as_list/1. + * src/mod_muc/mod_muc_log.erl: The logging code expect nicknames + to be in list() format. + 2009-02-23 Pablo Polvorin * src/ejabberd_c2s.erl, src/mod_echo.erl, src/mod_roster.erl, src/mod_roster_odbc.erl: Use exmpp_jid:to_binary/1 when possible. diff --git a/src/mod_muc/mod_muc_log.erl b/src/mod_muc/mod_muc_log.erl index ae8c89645..7f5c18718 100644 --- a/src/mod_muc/mod_muc_log.erl +++ b/src/mod_muc/mod_muc_log.erl @@ -138,7 +138,7 @@ init([Host, Opts]) -> file_format = FileFormat, css_file = CSSFile, access = AccessLog, - lang = Lang, + lang = list_to_binary(Lang), timezone = Timezone, spam_prevention = NoFollow, top_link = Top_link}}. @@ -211,29 +211,29 @@ add_to_log2(text, {Nick, Packet}, Room, Opts, State) -> ok; {'undefined', SubEl} -> Message = {body, exmpp_xml:get_cdata_as_list(SubEl)}, - add_message_to_log(Nick, Message, Room, Opts, State); + add_message_to_log(binary_to_list(Nick), Message, Room, Opts, State); {SubEl, _} -> Message = {subject, exmpp_xml:get_cdata_as_list(SubEl)}, - add_message_to_log(Nick, Message, Room, Opts, State) + add_message_to_log(binary_to_list(Nick), Message, Room, Opts, State) end; add_to_log2(roomconfig_change, _, Room, Opts, State) -> add_message_to_log("", roomconfig_change, Room, Opts, State); add_to_log2(nickchange, {OldNick, NewNick}, Room, Opts, State) -> - add_message_to_log(NewNick, {nickchange, OldNick}, Room, Opts, State); + add_message_to_log(binary_to_list(NewNick), {nickchange, binary_to_list(OldNick)}, Room, Opts, State); add_to_log2(join, Nick, Room, Opts, State) -> - add_message_to_log(Nick, join, Room, Opts, State); + add_message_to_log(binary_to_list(Nick), join, Room, Opts, State); add_to_log2(leave, {Nick, Reason}, Room, Opts, State) -> case binary_to_list(Reason) of - "" -> add_message_to_log(Nick, leave, Room, Opts, State); - R -> add_message_to_log(Nick, {leave, R}, Room, Opts, State) + "" -> add_message_to_log(binary_to_list(Nick), leave, Room, Opts, State); + R -> add_message_to_log(binary_to_list(Nick), {leave, R}, Room, Opts, State) end; add_to_log2(kickban, {Nick, Reason, Code}, Room, Opts, State) -> - add_message_to_log(Nick, {kickban, Code, binary_to_list(Reason)}, Room, Opts, State). + add_message_to_log(binary_to_list(Nick), {kickban, Code, binary_to_list(Reason)}, Room, Opts, State). %%----------------------------------------------------------------------