diff --git a/ChangeLog b/ChangeLog index f46777ed2..c3cabe035 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-10-31 Jean-Sébastien Pédron + + * src/mod_last_odbc.erl (store_last_info/4): Fix a bug where the + status was not converted to list before calling + ejabberd_odbc:escape/1. + (get_last_info/2): Fix a bug where the status was returned as a list + instead of a binary. + 2008-10-20 Jean-Sébastien Pédron * src/mod_irc/mod_irc.erl, src/mod_irc/mod_irc_connection.erl: Convert diff --git a/src/mod_last_odbc.erl b/src/mod_last_odbc.erl index 077a6ee52..64569fd69 100644 --- a/src/mod_last_odbc.erl +++ b/src/mod_last_odbc.erl @@ -135,7 +135,7 @@ store_last_info(User, Server, TimeStamp, Status) -> LServer = exmpp_stringprep:nameprep(Server), Username = ejabberd_odbc:escape(LUser), Seconds = ejabberd_odbc:escape(integer_to_list(TimeStamp)), - State = ejabberd_odbc:escape(Status), + State = ejabberd_odbc:escape(binary_to_list(Status)), odbc_queries:set_last_t(LServer, Username, Seconds, State) catch _ -> @@ -151,7 +151,7 @@ get_last_info(LUser, LServer) -> {selected, ["seconds","state"], [{STimeStamp, Status}]} -> case catch list_to_integer(STimeStamp) of TimeStamp when is_integer(TimeStamp) -> - {ok, TimeStamp, Status}; + {ok, TimeStamp, list_to_binary(Status)}; _ -> not_found end;