You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to write something to keep track of the state of contacts on my roster. I wanted to create a guard that would get me all status transitions so I could track who is online and who is offline. However I cannot find a guard that works for showing "available" status. The XMPP spec allows an essentially empty <presence/> tag to imply a status of "available". But writing a guard for <presence> results in catching much more information.
Here's the code I am trying to use:
status{ |s| logger.warn"JID #{s.from} is going #{s.state}"}
This works for all state changes except "available"
So then I tried looking adding a second guard to track <presence/> packets and use those to assume "available" state. However, that led to packets like this:
These are converted to Blather::Stanza::C objects which have no accessor for the <show/> element. This results in my code detecting this obviously "away" message as being an "available" message.
The text was updated successfully, but these errors were encountered:
So now imported stanzas will all be Presence instances, and will be decorated with the correct methods. This is a step towards moving Blather entirely to decorators. Right now, there are two issues:
Handlers don't work with decorators. You can only handle presence right now.
Creating a Presence::Status object using .new returns a decorated Presence instance. This is weird. We need factories.
I am trying to write something to keep track of the state of contacts on my roster. I wanted to create a guard that would get me all status transitions so I could track who is online and who is offline. However I cannot find a guard that works for showing "available" status. The XMPP spec allows an essentially empty
<presence/>
tag to imply a status of "available". But writing a guard for<presence>
results in catching much more information.Here's the code I am trying to use:
This works for all state changes except "available"
So then I tried looking adding a second guard to track
<presence/>
packets and use those to assume "available" state. However, that led to packets like this:These are converted to
Blather::Stanza::C
objects which have no accessor for the<show/>
element. This results in my code detecting this obviously "away" message as being an "available" message.The text was updated successfully, but these errors were encountered: