25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Fix nick logging in mod_muc_log plaintext (#522)

This commit is contained in:
Badlop 2015-04-14 15:46:43 +02:00
parent 25449a076f
commit b67af5e036

View File

@ -381,6 +381,11 @@ set_filemode(Fn, {FileMode, FileGroup}) ->
ok = file:change_mode(Fn, list_to_integer(integer_to_list(FileMode), 8)), ok = file:change_mode(Fn, list_to_integer(integer_to_list(FileMode), 8)),
ok = file:change_group(Fn, FileGroup). ok = file:change_group(Fn, FileGroup).
htmlize_nick(Nick1, html) ->
htmlize(<<"<", Nick1/binary, ">">>, html);
htmlize_nick(Nick1, plaintext) ->
htmlize(<<?PLAINTEXT_IN/binary, Nick1/binary, ?PLAINTEXT_OUT/binary>>, plaintext).
add_message_to_log(Nick1, Message, RoomJID, Opts, add_message_to_log(Nick1, Message, RoomJID, Opts,
State) -> State) ->
#logstate{out_dir = OutDir, dir_type = DirType, #logstate{out_dir = OutDir, dir_type = DirType,
@ -391,7 +396,7 @@ add_message_to_log(Nick1, Message, RoomJID, Opts,
State, State,
Room = get_room_info(RoomJID, Opts), Room = get_room_info(RoomJID, Opts),
Nick = htmlize(Nick1, FileFormat), Nick = htmlize(Nick1, FileFormat),
Nick2 = htmlize(<<"<", Nick1/binary, ">">>, FileFormat), Nick2 = htmlize_nick(Nick1, FileFormat),
Now = now(), Now = now(),
TimeStamp = case Timezone of TimeStamp = case Timezone of
local -> calendar:now_to_local_time(Now); local -> calendar:now_to_local_time(Now);