Not logged in. · Lost password · Register
Forum: XMPP XMPP Protocol RSS
Avatar
ayyrk #1
Member since Jul 2007 · 92 posts
Group memberships: Members, Premium
Show profile · Link to this post
Subject: Client Capabilities
Should a properly written AGSXMPP client control what other clients see as its capabilities?

My client doesn't support file transfer. Should my client make this fact query-able from other clients?

I am just wondering if clients are supposed to list their capabilities somehow.

Thanks!
Avatar
Alex #2
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Yes, this is what XEP-0115: Entity Capabilities does.

Caps supports also extensions. If your client is available in different versions (light, pro) or the user can turn on and off special features you should define caps extensions.

Capabilities should be cached. Also over session in some storage (database) when possible.

So if some of your contacts are using Client X ver. 1.2 you have to discover the features once for all this contacts/clients, assuming client is sending its capabilities.

Alex
Alexander Gnauck
AG-Software
Avatar
Koterpillar #3
Member since May 2007 · 32 posts · Location: Russia
Group memberships: Members
Show profile · Link to this post
What is the agsXMPP support for all that? I've seen the agsXMPP.protocol.extensions.caps namespace, but what about generating the "ver" attribute?
nebohodimo IM developer
Avatar
Alex #4
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
If you use the latest code from SVN you can do the following:

enables Caps, they will send automatically with the presence (SendMyPresence)
  1. xmppCon.EnableCapabilities = true;

Set the client version which will be send with your Caps
  1. xmppCon.ClientVersion = "1.1";

you can access the Caps element and set the other properties.
  1. xmppCon.Capabilities.Node = "http://www.ag-software.net/miniclient/caps";
  2. xmppCon.Capabilities.Extensions = new String[] { "filexfer" };

if your client has special features which can be enabled or disabled you can access the extensions and update them.

We are open to any comments how we can improve the caps in XmppClientConnection.

Alex
Alexander Gnauck
AG-Software
Avatar
Koterpillar #5
Member since May 2007 · 32 posts · Location: Russia
Group memberships: Members
Show profile · Link to this post
So you're saying that caching is to be done based on Node+Ext, not Ver attribute?
nebohodimo IM developer
Avatar
Alex #6
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
No, I only explained how to send your own caps. Maybe i misunderstood your question.

Caching capabilities should be done by node+version.

Alex
Alexander Gnauck
AG-Software
Avatar
Alex #7
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
and node+extension.

Alex
Alexander Gnauck
AG-Software
Avatar
Koterpillar #8
Member since May 2007 · 32 posts · Location: Russia
Group memberships: Members
Show profile · Link to this post
In reply to post #6
Are you saying I should put version just like "1.0" or "1.1" in ver, instead of what is specified in XEP (please read my link)? I'll see what other clients do though...
nebohodimo IM developer
Avatar
Alex #9
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
This paragraph is new in the XEP. I will check it again.

this is what the latest exodus version does:
  1. <presence>
  2. <c ext="xhtml-im" node="http://exodus.jabberstudio.org/caps" ver="0.10.0.0" xmlns="http://jabber.org/protocol/caps"/>
  3. <show>chat</show>
  4. <priority>1</priority>
  5. </presence>

this is what Psi sends
  1. <presence>
  2. <show>away</show>
  3. <status>I am away from my desk.  Leave a message.</status>
  4. <priority>5</priority>
  5. <c xmlns="http://jabber.org/protocol/caps" node="http://psi-im.org/caps" ver="0.12-dev-rev1" ext="cs ep-notify html" />
  6. </presence>

Alex
Alexander Gnauck
AG-Software
This post was edited on 2007-12-22, 00:07 by Alex.
Avatar
Alex #10
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
read the XEP again. They made changes which break the current logic :(
But i like this new logic because its easier for caching and the extensions which were confusing are gone.

So i think there should be a collection of categories and a collection of features in XmppClientConnection. When you fill this collections before connecting agsXMPP could create the caps (ver attribute) automatically, and also answer some disco request automatically.

What do you think about this?

Alex
Alexander Gnauck
AG-Software
Avatar
Koterpillar #11
Member since May 2007 · 32 posts · Location: Russia
Group memberships: Members
Show profile · Link to this post
The only compliant ver I've ever seen was from MRIM transport (an evil proprietary protocol here). Miranda and Pidgin send things like "2.3.1" too...
However, I'd appreciate the collection and automatic filling of ver, that (and disco handling I now do myself) will come handy...
nebohodimo IM developer
Avatar
Alex #12
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
ya, I have no idea when they changed the XEP. All existing clients to it the "old" way.
But this doesn't matter. I put it on my TODO list and hope to get it done after christmas.

Alex
Alexander Gnauck
AG-Software
Avatar
Alex #13
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
New caps class which can automatically create the version attribute from a DiscoInfo is in svn now.
There is a small example on the usage in disco.cs of CodeSnippets.

More stuff for this in XmppClientConnection is coming soon.

Alex
Alexander Gnauck
AG-Software
Avatar
Alex #14
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
XEP was updated again ;-)
http://www.xmpp.org/extensions/tmp/xep-0115-1.5.html

This is hopefully the last change. There is a new attribute for the hash now. Recommended is the usage of sha-1, but all registered IANA Hash functions are allowed.

I will implement the changes now.

Alex
Alexander Gnauck
AG-Software
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:
Forum: XMPP XMPP Protocol RSS