Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Page: previous  1  2 
Avatar
tjabber #16
Member since Feb 2008 · 42 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 2993
OK, so I'm testing using a Psi client.

In my code I do:

            mDiscoHelper = new DiscoHelper(mClientCon);

            // Tell the world we support chat states through discovery.
            mDiscoHelper.ClientFeatures.Add("http://jabber.org/protocol/chatstates");
            mDiscoHelper.ClientFeatures.Add("http://jabber.org/protocol/muc");


Now when I send a message to Psi it doesn't even do a discovery to find out this information, so it doesn't sent me chatstates. In messages I do see <active xmlns="http://jabber.org/protocol/chatstates" /> from Psi.

So it's not clear to me how it would know that I support chatstates. Interestingly I send it chatstates and it processes them.
Avatar
Jabberer #17
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
i repeat what Alex said before:
Discovery information should be cached, which can be the reason that Psi does not send you Discovery requests until you caps info or client version gets updated.

What we do in our tests to get always a new unique caps is:
  1. private void SetDiscoInfo()
  2. {
  3.     _connection.DiscoInfo.AddIdentity(new DiscoIdentity("pc", "MiniClient", "client"));
  4.  
  5.     _connection.DiscoInfo.AddFeature(new DiscoFeature(agsXMPP.Uri.DISCO_INFO));
  6.     _connection.DiscoInfo.AddFeature(new DiscoFeature(agsXMPP.Uri.DISCO_ITEMS));
  7.     _connection.DiscoInfo.AddFeature(new DiscoFeature(agsXMPP.Uri.MUC));
  8.    
  9.     _connection.DiscoInfo.AddFeature(new DiscoFeature(Guid.NewGuid().ToString()));
  10. }

we add always a random feature which generates a new caps hash, so we bypass the cache.
Software Developer
AG-Software
Avatar
tjabber #18
Member since Feb 2008 · 42 posts
Group memberships: Members
Show profile · Link to this post
I took everything down thinking that would clear the cache. I'm not sure where these caches are. In the client or in the server? So I tried your very smart idea with the following code:

 private void SetDiscoInfo()
 {
            mClientCon.DiscoInfo.AddIdentity(new DiscoIdentity("pc", "PCM", "client"));
            mClientCon.DiscoInfo.AddFeature(new DiscoFeature(agsXMPP.Uri.DISCO_INFO));
            mClientCon.DiscoInfo.AddFeature(new DiscoFeature(agsXMPP.Uri.MUC));
            mClientCon.DiscoInfo.AddFeature(new DiscoFeature(agsXMPP.Uri.CHATSTATES));

            // Add a random feature which generates a new caps hash, so we bypass the cache.
            mClientCon.DiscoInfo.AddFeature(new DiscoFeature(Guid.NewGuid().ToString()));

}// SetDiscoInfo

Still, Psi never does a discovery so the random string doesn't seem to make a difference. And it doesn't send the composing chatstate when I begin typing a reply.
Avatar
Jabberer #19
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
do you use caps? If yes how does your presence stanza including caps look?
Software Developer
AG-Software
Avatar
tjabber #20
Member since Feb 2008 · 42 posts
Group memberships: Members
Show profile · Link to this post
I don't use caps. If you have any example code I can toss it in. I had it in for a while, but when Alex said the extensions stuff was deprecated I decided just to delete it.

Shouldn't the discovery be enough?

Any ideas why Psi wouldn't ask what the client can do? I don't quite understand that part. When I connect Psi to a Spark client through Jabber.org I don't see anything either.
Avatar
tjabber #21
Member since Feb 2008 · 42 posts
Group memberships: Members
Show profile · Link to this post
I figured it out. Apparently these features only work for contacts, not just people who contact you for an IM session. This was my test case. Once I added a user as a contact then chatstates started working. Unfortunately no gone message was sent when the IM window was closed.

I suppose this is a distinction that everyone just knows. Thanks immensely for your help!
Avatar
Alex #22
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
yes it works only for subscribed contacts for this reasons:

  • Disco requests must be send to full Jids. If you start a chat to a contact you are not subscribed to you don't have a resource for this contact to discover.
  • clients which discover based on caps cannot disco because caps is included in the presence which you get only when you are subscribed.
  • I think most clients discover only the contacts. So even when the get a incoming message from a full jid they send no disco requests.

Alex
Avatar
Alex #23
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #20
Quote by tjabber:
I don't use caps. If you have any example code I can toss it in. I had it in for a while, but when Alex said the extensions stuff was deprecated I decided just to delete it.

The XEP should be in final stage now. I will update the caps code in agsXMPP with the next release.

Alex
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: previous  1  2 
Forum: agsXMPP RSS