Re: [jdev] Initial presence and contact capabilities

2008-12-05 Thread Dave Cridland
On Thu Dec  4 10:57:11 2008, Senko Rasic wrote:
> consider the following scenario:
> 1. user is offline
> 2. user wants to call some contact in roster via Jingle (or
>actually do anything which requires knowledge of contact's
>capabilities) which is in his/her roster
> 3. users's client comes online, requests roster, sends initial
>presence, etc.
> 4. user's server sends out presence probes, and presence from
>contacts comes in
> 5. after presence from contact is received, capabilities can be
>discovered and the user's action can proceed
> 
> The trouble is that there's no way of knowing when 4. finishes,
> so the client doesn't know if a particular contact's presence
> is unavailable, or just wasn't received yet.

Yes, you just need to timeout - as Justin says, some servers will  
send you the offline presence in response to a probe, too, which will  
cut short your timeout.

One thing that makes the timeout rather more bearable is if you ping  
the domain (or bare jid) of the contact. In this instance, you at  
least know the RTT for stanzas at that point, and also know whether  
the S2S link came up, so you know you *should* be getting probe  
responses very soon.

Dave.
-- 
Dave Cridland - mailto:[EMAIL PROTECTED] - xmpp:[EMAIL PROTECTED]
  - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
  - http://dave.cridland.net/
Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade
___
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [EMAIL PROTECTED]
___


Re: [jdev] Initial presence and contact capabilities

2008-12-04 Thread Justin Karneges
On Thursday 04 December 2008 07:10:25 Jonathan Schleifer wrote:
> That's the problem, the presences are often not synced when an s2s
> connection is established. Not all presences are pushed out in the s2s
> connection. And offline presences often aren't as well, so that people
> are online for ages. Sending all of them, even the offline ones, in
> one stanza would fix that.

In rfc3921bis, section 4.3.2 #2, the remote server being probed SHOULD reply 
in the offline case.

Granted, there's no guarantee that the server actually will, but the idea with 
the 'SHOULD' here is that we'll start encouraging the behavior.

-Justin
___
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [EMAIL PROTECTED]
___


Re: [jdev] Initial presence and contact capabilities

2008-12-04 Thread Tomasz Sterna
> > This is possible already without any additional XEP.
> >
> > Just push  packets after an S2S connection is established.
> >
> > And it is implementable both sides.
> > Your server could also pull all required presence states with
> > presence-probes to users on rosters of its users.
> 
> That's the problem, the presences are often not synced when an s2s  
> connection is established. Not all presences are pushed out in the s2s  
> connection. And offline presences often aren't as well, so that people  
> are online for ages. Sending all of them, even the offline ones, in  
> one stanza would fix that.

Well, yes...
XMPP RFCs do not mandate described presence synchronisation, but they do
not forbid it also.
These don't have to be in one stanza. You can push presences in multiple
stanzas (one presence per stanza) as usual and it will be handled as
usual.

Ergo - It's an implementation issue.


> PS: I'd prefer to continue this discussion on the standards list.

I'm not on Standards anymore.
-- 


___
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [EMAIL PROTECTED]
___


Re: [jdev] Initial presence and contact capabilities

2008-12-04 Thread Jonathan Schleifer

Am 04.12.2008 um 16:01 schrieb Tomasz Sterna:


This is possible already without any additional XEP.

Just push  packets after an S2S connection is established.

And it is implementable both sides.
Your server could also pull all required presence states with
presence-probes to users on rosters of its users.


That's the problem, the presences are often not synced when an s2s  
connection is established. Not all presences are pushed out in the s2s  
connection. And offline presences often aren't as well, so that people  
are online for ages. Sending all of them, even the offline ones, in  
one stanza would fix that.



I am not aware of any server that does that though, but I am not
familiar with the commercial ones.
But... all transports I've written works similar way - pulling all
registered users presences with probes after the T2S
(Transport-2-Server) connection establishment.


pyICQ-t does that, IIRC. It also sends presence for all offline users.

PS: I'd prefer to continue this discussion on the standards list.

--
Jonathan



PGP.sig
Description: This is a digitally signed message part
___
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [EMAIL PROTECTED]
___


Re: [jdev] Initial presence and contact capabilities

2008-12-04 Thread Tomasz Sterna
Dnia 2008-12-04, czw o godzinie 14:50 +0100, Jonathan Schleifer pisze:
> Maybe we should have a XEP that allows better exchange of presence  
> between server, that is when the s2s was just established? It often  
> gives timeout and a XEP that would list all JIDs of users from
> server  
> A for which users on server B have subscription could come in handy  
> here, it could have something like:
> 
> 
> 
> Some nice away message
> Offline message, if
> it  
> was specified on disconnection
> 

This is possible already without any additional XEP.

Just push  packets after an S2S connection is established.

And it is implementable both sides.
Your server could also pull all required presence states with
presence-probes to users on rosters of its users.


I am not aware of any server that does that though, but I am not
familiar with the commercial ones.
But... all transports I've written works similar way - pulling all
registered users presences with probes after the T2S
(Transport-2-Server) connection establishment.
-- 


___
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [EMAIL PROTECTED]
___


Re: [jdev] Initial presence and contact capabilities

2008-12-04 Thread Tomasz Sterna
Dnia 2008-12-04, czw o godzinie 14:49 +0100, Senko Rasic pisze:
> But in my use case, for offline contacts the client would
> return an error, while for contacts for which presence hasn't
> been received, it would wait until it is received.
> 
> My intention is to allow users to attempt a call (to someone
> on their roster) before the client is connected, by automagically
> connecting, getting presence, caps, and eventually calling if
> possible.

Is the error case really needed?
Couldn't you just handle both cases the second way?
It is possible that the offline contact gets online during the "waiting"
period. :-)

-- 


___
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [EMAIL PROTECTED]
___


Re: [jdev] Initial presence and contact capabilities

2008-12-04 Thread Jonathan Schleifer

Presences between servers are indeed a problem and very error-prone.

Maybe we should have a XEP that allows better exchange of presence  
between server, that is when the s2s was just established? It often  
gives timeout and a XEP that would list all JIDs of users from server  
A for which users on server B have subscription could come in handy  
here, it could have something like:




Some nice away message
Offline message, if it  
was specified on disconnection



What do you think?

--
Jonathan



PGP.sig
Description: This is a digitally signed message part
___
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [EMAIL PROTECTED]
___


Re: [jdev] Initial presence and contact capabilities

2008-12-04 Thread Senko Rasic
Tomasz Sterna wrote:
> Dnia 2008-12-04, czw o godzinie 11:57 +0100, Senko Rasic pisze:
>> The trouble is that there's no way of knowing when 4. finishes,
>> so the client doesn't know if a particular contact's presence
>> is unavailable, or just wasn't received yet.
> 
> What exactly is the difference between offline contact
> and contact which presence wasn't received yet?

In the XMPP world, as far as I understand, none.

But in my use case, for offline contacts the client would
return an error, while for contacts for which presence hasn't
been received, it would wait until it is received.

My intention is to allow users to attempt a call (to someone
on their roster) before the client is connected, by automagically
connecting, getting presence, caps, and eventually calling if
possible.

Regards,
Senko

-- 
Senko Rasic at Collabora <[EMAIL PROTECTED]>
___
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [EMAIL PROTECTED]
___


Re: [jdev] Initial presence and contact capabilities

2008-12-04 Thread Tomasz Sterna
Dnia 2008-12-04, czw o godzinie 11:57 +0100, Senko Rasic pisze:
> The trouble is that there's no way of knowing when 4. finishes,
> so the client doesn't know if a particular contact's presence
> is unavailable, or just wasn't received yet.

What exactly is the difference between offline contact
and contact which presence wasn't received yet?

-- 


___
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [EMAIL PROTECTED]
___


[jdev] Initial presence and contact capabilities

2008-12-04 Thread Senko Rasic
Hi,

consider the following scenario:
1. user is offline
2. user wants to call some contact in roster via Jingle (or
   actually do anything which requires knowledge of contact's
   capabilities) which is in his/her roster
3. users's client comes online, requests roster, sends initial
   presence, etc.
4. user's server sends out presence probes, and presence from
   contacts comes in
5. after presence from contact is received, capabilities can be
   discovered and the user's action can proceed

The trouble is that there's no way of knowing when 4. finishes,
so the client doesn't know if a particular contact's presence
is unavailable, or just wasn't received yet.

The only workaround I can think of is to introduce arbitrary
timeout, and wait until the presence is received (in which
case we can proceed to 5.) or it times out (in which case
we treat the contact as offline at the moment).

Is there a better way, or standard practice how to do this?

Regards,
Senko

-- 
Senko Rasic at Collabora <[EMAIL PROTECTED]>
___
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [EMAIL PROTECTED]
___