Project

General

Profile

How to get history from room?

Kelly Kuang
Added over 2 years ago

I have some questions about MUC history.

here is the scene:

create room

set config: muc#roomconfig_persistentroom=true, muc#maxhistoryfetch=5

  1. user A join to room

  2. user B join to room

  3. B send message "test message" to room, A receive message "test message"

  4. A disconnect

  5. B send message "test1" - "test10" (10 messages) to room.

  6. A reconnect and rejoin to room.

  7. A receive "test6" to "test10"

My question is:

How can A retrieve the "test1" to "test5"?

I do not want to increase the maxhistoryfetch value. Because the count of the messages maybe larger than the maxhistoryfetch.

I tried some solutions:

  1. Use Message Archive component

It does not work. Because Message Archive component only archive "received" messages.

  1. Use in , set "since" in

It does not work. A remenber the time of disconnect. When A rejoin room, he set the "since" value to disconnect time. But Tigase only return "test6" to "test10", not "test1" to "test10".

I confirm the "since" has work, but Tigase only return the newest message since the time.

I check the code and find the SQL set "order by timestamp desc"(tigase.muc.history.MySqlHistoryProvider), so Tigase only return the last messages.


Replies (2)

Added by Wojciech Kapcia TigaseTeam over 2 years ago

Which version do you use? I've tested with the latest and it works correctly. Also:

I confirm the "since" has work, but Tigase only return the newest message since the time.

that would be idea - return all messages since the given time.

You can selectively retrieve messages from 1 to 5 and skip 6 to 10 - it's the limitation of MUC protocol.

(1)

Added by Kelly Kuang over 2 years ago

Thank you very much.

    (1-2/2)