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

Handling of Delayed Messages #41

Open
qbasicer opened this issue Jun 25, 2015 · 1 comment
Open

Handling of Delayed Messages #41

qbasicer opened this issue Jun 25, 2015 · 1 comment

Comments

@qbasicer
Copy link

I'm attempting to add support to my small project to discard delayed messages, however, I cannot figure out a way to tell a delayed message from a realtime message.

I see in the debugging that the message looks like:

<message from='FROM@SOME.TLD' id='purple6996803f' to='TO@SOME.TLD' type='chat'>
    <active xmlns='http://jabber.org/protocol/chatstates'/>
    <body>askjl</body>
    <delay from='SOME.TLD' stamp='2015-06-25T21:03:28Z' xmlns='urn:xmpp:delay'/>
    <x from='SOME.TLD' stamp='20150625T21:03:28' xmlns='jabber:x:delay'/>
</message>

Best I can determine is I'm supposed to use the XDelay class, but I can't figure out how I'm supposed to use it? Can you help?

@defenestration
Copy link

The x field is the key, i use:

@mucclients[:"#{@prefs.channelname}"].add_message_callback do |message| unless "#{message.x}" =~ /jabber:x:delay/

These messages are just backlogs reported to the jabber client from the server based on a server setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants