Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Page:  1  2  next
Avatar
tjabber #1
Member since Feb 2008 · 42 posts
Group memberships: Members
Show profile · Link to this post
Subject: Do chatstates take anything special to support?
Using Psi or Spark I don't see chat states like composing being sent. These give you those nice "user is typing" type of messages in your client. Spark says they support chat states but I never see them sent. They are always embedded with a message:
     <message id="4HkVW-30" to="" from="" type="chat"><body>hi</body><thread>qV7b8p</thread><x xmlns="jabber:x:event"><offline/><composing/></x></message>

Getting a composing element in the actual message does very little good.

I looked in the discovery stream and I didn't notice anything that indicated if a client should send chat states or not.

Does anyone know if there's anything special needed for clients to send chat states correctly?

thanks
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
There are 2 extensions for typing events:


some clients supports both of them, some only one of both, some none. No idea what Spark has implemented.
Before sending the events you should discover if the receiving clients support and request them. Many clients send them all the time which is not a good behavior. E.g if your contact is on a mobile phone he normally doesn't want this unnecessary traffic.

here is a very good thread about this with a working example:
http://forum.ag-software.de/forum.php?req=thread&id=260

Alex
Avatar
tjabber #3
Member since Feb 2008 · 42 posts
Group memberships: Members
Show profile · Link to this post
I've read that thread and I think I'm doing the right thing, but none of the clients I use send out chat states independent of the message. I watch their debug XML and they simply don't send it. Which is why I thought it might be a configuration deal.

Do you know of a client that definitely sends out chat states correctly?

thanks
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I'm pretty sure that Psi and Pandion support them.
Do you advertise the chatstate support in disco?

Alex
Avatar
tjabber #5
Member since Feb 2008 · 42 posts
Group memberships: Members
Show profile · Link to this post
I don't advertise anything from my client.
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
this maybe the problem. Look at this section of the XEP:
http://www.xmpp.org/extensions/xep-0085.html#disco

Alex
Avatar
tjabber #7
Member since Feb 2008 · 42 posts
Group memberships: Members
Show profile · Link to this post
What is interesting is I never see Psi or Spark do a discovery request so they would have no way of knowing if I support chatstate are not.

I do see Psi send:

presence xmlns="jabber:client" from=user@XX/X" to="user2\40YY.com@XX/client">
<priority>5</priority>
<c xmlns="http://jabber.org/protocol/caps" ext="cs ep-notify html" ver="0.11-dev-rev8" node="http://psi-im.org/caps" />
</presence>

So does this mean I should add capability and set cs as an extension and that discovery isn't used by clients?
Avatar
Alex #8
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by tjabber:
What is interesting is I never see Psi or Spark do a discovery request so they would have no way of knowing if I support chatstate are not.

clients should discover support for chatstates. But clients should also cache all this information. So its possible that they discovered your info once and use the cached info until your version info or caps will change.

Quote by tjabber:
I do see Psi send:

  1. <presence xmlns="jabber:client" from="user@XX/X" to="user2\40YY.com@XX/client">
  2. <priority>5</priority>
  3. <c xmlns="http://jabber.org/protocol/caps" ext="cs ep-notify html" ver="0.11-dev-rev8" node="http://psi-im.org/caps" />
  4. </presence>

So does this mean I should add capability and set cs as an extension and that discovery isn't used by clients?

adding capability is a good idea. In the latest version of caps we got rid of the extensions. So you shouldn't use them anymore.
For more info look at:
XEP-0115: Entity Capabilities

Alex
Avatar
tjabber #9
Member since Feb 2008 · 42 posts
Group memberships: Members
Show profile · Link to this post
I can't get it to work so I'm going to just give up. There's no way to tell what isn't working or why it isn't working.
Avatar
tjabber #10
Member since Feb 2008 · 42 posts
Group memberships: Members
Show profile · Link to this post
I have revelation on this. Part of my problem was that I couldn't get my clients to send composing messages at all. This turned out to because of a misconfigured server. Always configure the host name using the fully qualified domain name, even if it's your own local host.

So the spark client does indeed display a composing and idle behavior. I was confused because I see no chatstates in the log at all. On examining the log I noticed these:

<message id="a447a-41" to="user\40company.com@host/spark" from="user2\40company@host/spark"><x xmlns="jabber:x:event"><composing/><id>fabf159d7de546989d3fa79898680484</id></x></message>

Low and behold there's an XEP-0022 Messaging Events standard that the client is using to communicate this information. Chatstates aren't used at all. So all the work worrying about advertising chatstates and wondering why nobody paid attention to them was a complete waste.

My little observation that "Spark says they support chat states but I never see them sent. They are always embedded with a message:" really is the standards way of saying that you want those types of notifications! It doesn't mean they are sending you composing. Oh my.

So, I'm going to toss the chatstate code and use this protocol and die happy because I finally figured out why this simple sounding feature that using another IM protocol took me a few minutes to implement, didn't work.

I still wonder how a client is supposed to know when a chat partner closes their IM window? In a chat room you get a presence notification , but nothing for type chat. It makes it impossible for the other side to know  when to close their session object for the chat session.
This post was edited on 2008-03-12, 20:24 by tjabber.
Avatar
Alex #11
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by tjabber:
I still wonder how a client is supposed to know when a chat partner closes their IM window? In a chat room you get a presence notification , but nothing for type chat. It makes it impossible for the other side to know  when to close their session object for the chat session.

this is possible with chatstates ;-)

got this xml some minutes ago from my Psi client:

  1. <message type="chat" to="xxx@server.com/console" id="aafaa" >
  2. <composing xmlns="http://jabber.org/protocol/chatstates"/>
  3. </message>
  4.  
  5.  
  6. <message type="chat" to="xxx@server.com/console" id="aafba" >
  7. <paused xmlns="http://jabber.org/protocol/chatstates"/>
  8. </message>

chatstate support is discovered via disco and caps.
XEP-0022 Messaging Events is a very old XEP from the old Jabber days and deprecated. Its implemented in many clients with a "old codebase", but I would not suggest to use them in new clients.
Avatar
tjabber #12
Member since Feb 2008 · 42 posts
Group memberships: Members
Show profile · Link to this post
> this is possible with chatstates

But if clients don't support them then you still need some sort of timeout mechanism on top?


> chatstate support is discovered via disco and caps.

Only three mechanisms for something that is so simple? :-)
Avatar
Alex #13
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by tjabber:
But if clients don't support them then you still need some sort of timeout mechanism on top?

clients do support them, so are testing with the wrong clients ;-). Even Pandion which had no updates for about 2 years supports them.

Quote by tjabber:
> chatstate support is discovered via disco and caps.

Only three mechanisms for something that is so simple? :-)
why 3? You need disco for most of the xmpp extensions. And caps is a must have for a client IMHO.
Avatar
Alex #14
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
see also:
Avatar
tjabber #15
Member since Feb 2008 · 42 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #11
Interestingly I don't see Psi sending me composing in jabber:x:event even though I asked for it and it doesn't seem to be doing anything with my composing events.
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:
Page:  1  2  next
Forum: agsXMPP RSS