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

Remove useless case clauses

This commit is contained in:
Evgeniy Khramtsov 2011-09-05 16:48:04 +10:00
parent ffdf5cb206
commit de712e5ccb

View File

@ -813,13 +813,9 @@ process_channel_topic_who(StateData, Chan, String) ->
Words = string:tokens(String, " "), Words = string:tokens(String, " "),
Msg1 = case Words of Msg1 = case Words of
[_, "333", _, _Chan, Whoset , Timeset] -> [_, "333", _, _Chan, Whoset , Timeset] ->
case string:to_integer(Timeset) of {Unixtimeset, _Rest} = string:to_integer(Timeset),
{Unixtimeset, _Rest} -> "Topic for #" ++ Chan ++ " set by " ++ Whoset ++
"Topic for #" ++ Chan ++ " set by " ++ Whoset ++ " at " ++ unixtime2string(Unixtimeset);
" at " ++ unixtime2string(Unixtimeset);
_->
"Topic for #" ++ Chan ++ " set by " ++ Whoset
end;
[_, "333", _, _Chan, Whoset | _] -> [_, "333", _, _Chan, Whoset | _] ->
"Topic for #" ++ Chan ++ " set by " ++ Whoset; "Topic for #" ++ Chan ++ " set by " ++ Whoset;
_ -> _ ->
@ -1327,15 +1323,12 @@ filter_mirc_colors(Msg) ->
unixtime2string(Unixtime) -> unixtime2string(Unixtime) ->
Secs = Unixtime + calendar:datetime_to_gregorian_seconds( Secs = Unixtime + calendar:datetime_to_gregorian_seconds(
{{1970, 1, 1}, {0,0,0}}), {{1970, 1, 1}, {0,0,0}}),
case calendar:universal_time_to_local_time( {{Year, Month, Day}, {Hour, Minute, Second}} =
calendar:gregorian_seconds_to_datetime(Secs)) of calendar:universal_time_to_local_time(
{{Year, Month, Day}, {Hour, Minute, Second}} -> calendar:gregorian_seconds_to_datetime(Secs)),
lists:flatten( lists:flatten(
io_lib:format("~4..0w-~2..0w-~2..0w ~2..0w:~2..0w:~2..0w", io_lib:format("~4..0w-~2..0w-~2..0w ~2..0w:~2..0w:~2..0w",
[Year, Month, Day, Hour, Minute, Second])); [Year, Month, Day, Hour, Minute, Second])).
_->
"0000-00-00 00:00:00"
end.
toupper([C | Cs]) -> toupper([C | Cs]) ->
if if