mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
* src/mod_muc/mod_muc_log.erl: Fix XHTML compliance: ensure some
language is set, include ID attribute in each message, add microseconds to ensure unique value (EJAB-497) SVN Revision: 1426
This commit is contained in:
parent
1f004c56ac
commit
fc911a43ff
@ -1,5 +1,9 @@
|
|||||||
2008-07-09 Badlop <badlop@process-one.net>
|
2008-07-09 Badlop <badlop@process-one.net>
|
||||||
|
|
||||||
|
* src/mod_muc/mod_muc_log.erl: Fix XHTML compliance: ensure some
|
||||||
|
language is set, include ID attribute in each message, add
|
||||||
|
microseconds to ensure unique value (EJAB-497)
|
||||||
|
|
||||||
* src/mod_register.erl: Support for io_lib newline character in
|
* src/mod_register.erl: Support for io_lib newline character in
|
||||||
the body of welcome_message (EJAB-501)
|
the body of welcome_message (EJAB-501)
|
||||||
* doc/guide.tex: Document the newline character
|
* doc/guide.tex: Document the newline character
|
||||||
|
@ -120,9 +120,11 @@ init([Host, Opts]) ->
|
|||||||
NoFollow = gen_mod:get_opt(spam_prevention, Opts, true),
|
NoFollow = gen_mod:get_opt(spam_prevention, Opts, true),
|
||||||
Lang = case ejabberd_config:get_local_option({language, Host}) of
|
Lang = case ejabberd_config:get_local_option({language, Host}) of
|
||||||
undefined ->
|
undefined ->
|
||||||
"";
|
case ejabberd_config:get_global_option(language) of
|
||||||
L ->
|
undefined -> "en";
|
||||||
L
|
L -> L
|
||||||
|
end;
|
||||||
|
L -> L
|
||||||
end,
|
end,
|
||||||
{ok, #state{host = Host,
|
{ok, #state{host = Host,
|
||||||
out_dir = OutDir,
|
out_dir = OutDir,
|
||||||
@ -286,9 +288,10 @@ add_message_to_log(Nick1, Message, RoomJID, Opts, State) ->
|
|||||||
top_link = TopLink} = State,
|
top_link = TopLink} = State,
|
||||||
Room = get_room_info(RoomJID, Opts),
|
Room = get_room_info(RoomJID, Opts),
|
||||||
|
|
||||||
|
Now = now(),
|
||||||
TimeStamp = case Timezone of
|
TimeStamp = case Timezone of
|
||||||
local -> calendar:now_to_local_time(now());
|
local -> calendar:now_to_local_time(Now);
|
||||||
universal -> calendar:now_to_universal_time(now())
|
universal -> calendar:now_to_universal_time(Now)
|
||||||
end,
|
end,
|
||||||
{Fd, Fn, _Dir} = build_filename_string(TimeStamp, OutDir, Room#room.jid, DirType),
|
{Fd, Fn, _Dir} = build_filename_string(TimeStamp, OutDir, Room#room.jid, DirType),
|
||||||
{Date, Time} = TimeStamp,
|
{Date, Time} = TimeStamp,
|
||||||
@ -382,10 +385,12 @@ add_message_to_log(Nick1, Message, RoomJID, Opts, State) ->
|
|||||||
{Hour, Minute, Second} = Time,
|
{Hour, Minute, Second} = Time,
|
||||||
STime = lists:flatten(
|
STime = lists:flatten(
|
||||||
io_lib:format("~2..0w:~2..0w:~2..0w", [Hour, Minute, Second])),
|
io_lib:format("~2..0w:~2..0w:~2..0w", [Hour, Minute, Second])),
|
||||||
|
{_, _, Microsecs} = Now,
|
||||||
|
STimeUnique = io_lib:format("~s.~w", [STime, Microsecs]),
|
||||||
|
|
||||||
% Write message
|
% Write message
|
||||||
file:write(F, io_lib:format("<a name=\"~s\" href=\"#~s\" class=\"ts\">[~s]</a> ~s~n",
|
file:write(F, io_lib:format("<a id=\"~s\" name=\"~s\" href=\"#~s\" class=\"ts\">[~s]</a> ~s~n",
|
||||||
[STime, STime, STime, Text])),
|
[STimeUnique, STimeUnique, STimeUnique, STime, Text])),
|
||||||
|
|
||||||
% Close file
|
% Close file
|
||||||
file:close(F),
|
file:close(F),
|
||||||
|
Loading…
Reference in New Issue
Block a user