Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
Govardhan N #1
Member since Mar 2018 · 10 posts
Group memberships: Members
Show profile · Link to this post
Subject: Retrieve all old messages in bulk using Matrix vNext
Hello Alex,

Right now the messages are being fetched one by one. We are following the code as given to retrieve the messages.

  1. xmppClient
  2.     .XmppXElementStreamObserver
  3.         .Where(el =>
  4.             el.OfType<Message>()
  5.             && el.Cast<Message>().Type == MatriXMessageType.GroupChat)
  6.     .Subscribe(el =>
  7.     {
  8.         // handle the message here
  9.         Debug.WriteLine(el.ToString());
  10.     });
Is there a way to fetch all old messages in bulk using Matrix vNext? Could you please give us any sample code if there are any?
This post was edited on 2018-05-04, 17:49 by Alex.
Avatar
Govardhan N #2
Member since Mar 2018 · 10 posts
Group memberships: Members
Show profile · Link to this post
Continuation to the previous post.

1) If there is a possibility to query results via pagination or last 20/50 etc.
2) Can we only query unread messages. Otherwise every time we fetch all the messages.

Fetching messages one by one results in a lot of delay and user will have to wait until all the messages are are received.

Any direction is appreciated. Thanks for your support.
Avatar
Alex #3
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
observers are realtime streams. Packets are available on the Observer as soon as they come in.
When you want to retrieve old messages then you have to build a store for them in your application.
Or use an extension like message archiving when supported by your server.

see also:
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