25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

o In store_last_info/4, fix a bug where the status was not converted to

list before calling ejabberd_odbc:escape/1.
o  In get_last_info/2, fix a bug where the status was returned as a list
instead of a binary.

SVN Revision: 1690
This commit is contained in:
Jean-Sébastien Pédron 2008-12-01 12:16:41 +00:00
parent 0313adaec6
commit 7088ba88a9
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2008-10-31 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
* 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 <js.pedron@meetic-corp.com>
* src/mod_irc/mod_irc.erl, src/mod_irc/mod_irc_connection.erl: Convert

View File

@ -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;