25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

Fix mod_muc_log skipping non-Latin messages (thanks to Yandrey)(#3115)

This commit is contained in:
Badlop 2019-12-16 10:38:53 +01:00
parent 24ac62eabd
commit 869826c818

View File

@ -440,12 +440,10 @@ add_message_to_log(Nick1, Message, RoomJID, Opts,
{_, _, Microsecs} = Now, {_, _, Microsecs} = Now,
STimeUnique = io_lib:format("~ts.~w", STimeUnique = io_lib:format("~ts.~w",
[STime, Microsecs]), [STime, Microsecs]),
catch fw(F, fw(F, io_lib:format("<a id=\"~ts\" name=\"~ts\" href=\"#~ts\" "
list_to_binary(
io_lib:format("<a id=\"~ts\" name=\"~ts\" href=\"#~ts\" "
"class=\"ts\">[~ts]</a> ", "class=\"ts\">[~ts]</a> ",
[STimeUnique, STimeUnique, STimeUnique, STime]) [STimeUnique, STimeUnique, STimeUnique, STime])
++ Text), ++ Text,
FileFormat), FileFormat),
file:close(F), file:close(F),
ok. ok.
@ -529,7 +527,7 @@ fw(F, S, FileFormat) when is_atom(FileFormat) ->
fw(F, S, [], FileFormat). fw(F, S, [], FileFormat).
fw(F, S, O, FileFormat) -> fw(F, S, O, FileFormat) ->
S1 = (str:format(binary_to_list(S) ++ "~n", O)), S1 = <<(str:format(S, O))/binary, "\n">>,
S2 = case FileFormat of S2 = case FileFormat of
html -> html ->
S1; S1;