Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
yyh_p #1
Member since Jul 2011 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: Group Chat history
Hi Alex,

Does Matrix have support to get group chat history?

One of the major requirement for my chat client is a function to get and save the chat history of a persistent conference room from an inputted time period (for example: get chat history for current room from 2 days ago).

We' re using Openfire ver 3.6.4 for the server.
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
group chat history is described here in the XEP-0045.
Normally the room sends you the history when you enter the room. Then you can additionally pass parameters for the history. I have never tried to request the history again when I am already in the room. You have to test if servers support this.

To request the history for the last xx seconds join the room with the following code, don't use MucManager.Enter.

  1. var to = new Jid(room);
  2. to.Resource = nickname;
  3.  
  4. var pres = new Presence();
  5. pres.To = to;
  6.  
  7. var x = new  Matrix.Xmpp.Muc.X();
  8. var hist = new  Matrix.Xmpp.Muc.History { Seconds = xx};
  9. x.History = hist;
  10.  
  11. pres.Add(x);
  12.  
  13. xmppCon.Send(pres);
Avatar
yyh_p #3
Member since Jul 2011 · 8 posts
Group memberships: Members
Show profile · Link to this post
thanks for the swift reply, Alex.

I've tried your code on my server and it didn't work. If a user is already in a room, the server will do nothing when that user tries to reenter the room.

In order to get the history, we will have to first exit the conference and reenter.

Can you think of another way to do this?
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by yyh_p:
Can you think of another way to do this?

This is exactly how it is designed in XEP-0045 Multi-User Chat.
When your servers has no special extensions for requesting the history again for participants, or without being member of a room then there is no other way. Please consult your server vendor.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS