Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
Ranu #1
Member since Jul 2013 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: Retrieve chat history
I want to retrieve message history for a particular user. Such that when user logs in I want to fetch all the chat history for that user.
Is there any direct api for retrieving message history ?
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
normally clients store the history in a local database and retrieve them on their own without special XMPP extensions.

There is also server side message archiving when your server supports this feature. see:
XEP-0136: Message Archiving

protocol classes for XEP-0136 are currently not implmemted in MatriX.

Alex
Avatar
Ranu #3
Member since Jul 2013 · 3 posts
Group memberships: Members
Show profile · Link to this post
Thanks for your reply.

In my case client stores it temporarily until user log off. So every time user logs in history has to be fetched from server & saved in temp db.
I know our server supports message archiving.

protocol classes for XEP-0136 are currently not implemented in MatriX.

How abt using Iqfilter & then call SendIq\SendIqSynchronous  ?
This post was edited on 2013-07-17, 20:03 by Ranu.
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
When you store it until you log off you already have all messages.

Messages sent to you while you are offline get delivered automatically from your server when you login again. There is no additional code required.

Alex
Avatar
Ranu #5
Member since Jul 2013 · 3 posts
Group memberships: Members
Show profile · Link to this post
What if user wants to retrieve old messages?  (say week old or 5 day old message)
I cannot keep old messages in temp db because next time when a new user logs in I do not want the new user to have access to previous user's messages.
Avatar
Alex #6
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you can protect the database and make it available only to teh user it belongs to.

As I said before there is server side archieving XEP-0136. When you server supports this you can use it.
Avatar
Alex #7
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #3
Quote by Ranu:
How abt using Iqfilter & then call SendIq\SendIqSynchronous  ?
yes this will work.
Avatar
Alex #8
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
just to update this thread. Message archiving XEP-0136 is supported in MatriX for a while now.
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