mod_last_odbc question for state column

Could someone explain what state column is used for on mod_last?
Currently, it's not being used and always empty/null.
Can this be used for last presence status if I modify the mod_last_odbc.erl file?

kamila wrote: Could someone

kamila wrote:

Could someone explain what state column is used for on mod_last?
Currently, it's not being used and always empty/null.

See http://xmpp.org/extensions/xep-0012.html#example-5

Thanks for the info badlop.

Thanks for the info badlop. But, I think I have found a problem on mod_last_odbc module.
State (Status) column is not being updated at all. I've tried this with many clients and many variations.

I don't know if this part of code has something to do with it:

set_last_t(LServer, Username, Seconds, State) ->
    update(LServer, "last", ["username", "seconds", "state"],
   [Username, Seconds, State],
   ["username='", Username, "'"]).

Check your clients really send the state

kamila wrote:

State (Status) column is not being updated at all. I've tried this with many clients and many variations.

I've tried with ejabberd 2.1.6 and 2.1.x, and Tkabber. I can't find in Psi or Gajim anyway to logout with a status.

When I tell Tkabber to logout with a specific reason, my client sends to ejabberd:

<presence type='unavailable'>
  <priority>8<priority>
  <status>testing the disconnection reason<status>
<presence>

Looking at the calls made by ejabberd, I see this:

odbc_queries:set_last_t("odbc.localhost", "badlop", "1305797344", "testing the disconnection reason").

Finally, the table stores the state correctly:

mysql> SELECT * FROM last;
+----------+------------+----------------------------------+
| username | seconds    | state                            |
+----------+------------+----------------------------------+
| badlop   | 1305797344 | testing the disconnection reason |
| badlop2  | 1305358845 |                                  |
+----------+------------+----------------------------------+
2 rows in set (0.00 sec)

Thank you

I have my own client app. I was setting the presence to unavailable and disconnecting the socket to server.
If I don't use the disconnection and let the type="unavailable" do the job, everything works fine.
Thanks for all your help Badlop. You've been really helpful with all of my questions.

Syndicate content