Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

See complete history (XEP-0313) #150

Closed
v1r0x opened this issue Apr 14, 2015 · 23 comments · Fixed by #493
Closed

See complete history (XEP-0313) #150

v1r0x opened this issue Apr 14, 2015 · 23 comments · Fixed by #493

Comments

@v1r0x
Copy link

v1r0x commented Apr 14, 2015

I really like your app, but there is one thing missing.
I already compiled and installed a new version of ejabberd, to get mod_carboncopy (XEP-0280) and mod_mam (XEP-0313)

I also activated Carbon Copy in jsxc-owncloud Settings.
But I have two problems:

  • I can only access the last ~10 messages and not the whole history
  • The history of my laptop is only on my laptop and not on my desktop pc

And idea? :)

@sualko
Copy link
Member

sualko commented Apr 14, 2015

  1. You can save more than 10 messages if you set numberOfMsg to a higher value (https://github.com/jsxc/jsxc/wiki/Options).

  2. XEP-0313 is not yet implemented, but we always appreciate pull requests ;-).

@sualko sualko changed the title See complete history See complete history (XEP-0313) Apr 14, 2015
@v1r0x
Copy link
Author

v1r0x commented Apr 14, 2015

  1. Thanks, didn't see the options. Sorry.
    But one question: Where can I set these options?
  2. I'm currently writing my master thesis, so I don't have much time for other big projects. But if I have the time (and knowledge of xmpp) I'll try to help :)

@ltsavar
Copy link

ltsavar commented Apr 20, 2015

I would also like to see this feature :)

@v1r0x
Copy link
Author

v1r0x commented Apr 27, 2015

I still couldn't find the correct file to edit these options (I found the options in at least 3 files). Could you give me a hint? :)

@sualko
Copy link
Member

sualko commented Apr 27, 2015

Add numberOfMsg to the init options in js/ojsxc.js. e.g.

...
jsxc.init({
      app_name: 'Owncloud',
      numberOfMsg: 100,
      loginForm: {
...

@jacek213
Copy link

+1 for XEP-0313 support

@nickbroon
Copy link

👍

@julian-d
Copy link

julian-d commented May 19, 2016

+1 for XEP-0313 support

Any updates on this issue?

@samweisgamdschie
Copy link

same here +1 for XEP-0313!

@LEDfan
Copy link
Contributor

LEDfan commented Aug 1, 2016

Hey, I started working on this a bit.

Which version of the XEP should we support? Version 0.2 http://xmpp.org/extensions/attic/xep-0313-0.2.html and version 0.3 http://xmpp.org/extensions/attic/xep-0313-0.3.html both has a plugin for Strophe.JS, but there are also version 0.4 and 0.5.

I have something working with Prosody, which is using version 0.3.

Should it support all versions, or only the latest?

@DanScharon
Copy link

@LEDfan as Prosody is pretty widespread, I think it should be supported

@sualko
Copy link
Member

sualko commented Aug 3, 2016

I would go with the latest version, because the version history shows, that there only some clarifications and bug fixes. @LEDfan thank you for working on this.

@skyfox675
Copy link

@LEDfan how would I setup a pull request for your working version to use with my ejabberd instance?

@dteleguin
Copy link

@LEDfan, any progress on that? Sorry for bothering, but turns out there is high demand for server-side history in JSXC. Do you need any assistance?

@niteshhardia
Copy link

Hello, i am interested in server-side history in JSXC, what i have observed that in the same system where history was generated, the history is gone when clearing out cache and cookie of that system, can someone help i am stuck ?

@singh1114
Copy link

Hello guys,
I want to work on this issue. I have included the latest file from the strophejs-plugins and placed it inside the jsxc/lib/ folder. How to start working on this issue.

https://github.com/strophe/strophejs-plugins/blob/master/mam/strophe.mam.v0.3.js

Now a file strophe.mam.js is in the folder jsxc/lib/. Now I want to include this functionality, for that I have created a file in jsxc/src/ named jsxc.lib.mam.js.

Please help me to get started. If you have any update about the issue please tell.

@sualko
Copy link
Member

sualko commented Jan 8, 2017

@singh1114 We are really happy that you want to work on this highly desired feature and if you have any questions, don't hesitate to write me an email. The proceeding could be as follows:

  1. Fork the project
  2. Create a new branch
  3. Add the mam plugin as dependency similar to this commit
  4. Create a pull request with the title "[WIP] Message Archive Management (XEP-0313)" so we can discuss features or other questions
  5. Get to know XEP-0313
  6. Think about a policy when do you want to query the archive and write about it in your pr
  7. e.g. use the init.window.jsxc event to load messages if a window is initialized

Happy coding!

@Seczilla
Copy link

I was working with Strophe and XEP-0313.
I don't know if helps you but I used a function to retrieve messages from the archive (mostly taken from http://stackoverflow.com/questions/32242088/strophe-mam-how-to-display-the-messages):

getHistory('user1@jabber-dev.server', 50, '');

function getHistory(userid, count, before){
    var q = {
      onMessage: function(message) {
        var id = message.querySelector('result').getAttribute('id');
        var fwd = message.querySelector('forwarded');
        var d = fwd.querySelector('delay').getAttribute('stamp');
        var msg = fwd.querySelector('message');
        var msg_data = {
            id:id,
            timestamp: (new Date(d)),
            timestamp_orig: d,
            from: Strophe.getBareJidFromJid(msg.getAttribute('from')),
            to: Strophe.getBareJidFromJid(msg.getAttribute('to')),
            type: msg.getAttribute('type'),
            body: msg.getAttribute('body'),
            message: Strophe.getText(msg.getElementsByTagName('body')[0])
        };

        var sender = Strophe.getBareJidFromJid(msg_data.from);

        $('#history').append(d + ': ' + sender + ' said: ' + msg_data.message + '<br>');
        return true;
      },

      onComplete: function(response) {
        console.log(response);
        $('#history').append('Completed.<br>');
        return true;
      }
    };

    $.extend(q, {'with': userid, 'before': before, 'max': count});

    connection.mam.query(Strophe.getBareJidFromJid(connection.jid), q);
}

The only problem I had was to request multiple archives at the same time ( see http://stackoverflow.com/questions/41376131/strophe-mam-js-get-multiple-archives)

@DanScharon DanScharon mentioned this issue Mar 7, 2017
Closed
@sualko sualko added this to the 3.1.2 milestone Mar 17, 2017
@sualko
Copy link
Member

sualko commented Mar 20, 2017

@andrey-utkin
Copy link

Wow!

Have tested. In some cases, it works correct. In others, no history appears, and it sometimes doesn't even show a button "Load older messages" (i have tested fetching history with Conversations and it works). Or, just random messages sent by me to buddy appear. but no messages from buddy to me, and these messages are not the last ones.

XMPP server: Prosody trunk.

@sualko
Copy link
Member

sualko commented Mar 21, 2017

@andrey-utkin Can you try to describe in more detail in which cases this doesn't work, because otherwise I have no indication where the issue could be.

@andrey-utkin
Copy link

andrey-utkin commented Mar 21, 2017 via email

@sualko
Copy link
Member

sualko commented Mar 29, 2017

@andrey-utkin Can you send some test credentials to klaus@jsxc.org? And please post your reviews/bugs/etc to the pr issue.

@jsxc jsxc locked and limited conversation to collaborators Mar 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet