[Twisted-Python] Writing a Jabber client

darryl developer at csrules.dyndns.org
Mon May 24 17:56:22 MDT 2004


darryl wrote:

> E.A.M. Huijbers wrote:
>
>> Hi all,
>>
>> I'm having trouble writing a Jabber client with Twisted. I came 
>> across a simple sample[0], and tried to build out from it, but for 
>> some reason it's barely working.
>>
>> When I run the application in the attached script, the logon goes 
>> fine, and I can receive messages sent to the account, but it never 
>> seems to receive subscription requests. When I ran it on an account 
>> that already had some items on the contact list, I did receive 
>> <presence> messages to indcate that a user changed status, but I 
>> don't receive <presence type="subscribe"> messages...
>
>
>
>
> That sample code is mine. I never played with subscriptions really but 
> after trying it out right now it appears that it's not working :(
>
> I don't know why yet, but i'll try and figure it out. We definately 
> can receive normal presence messages but don't seem to see 
> subscription requests....
>
> Doesn't make sense at first blush.
>
> -darryl
>
When in doubt read the protocol docs i guess:


7.3 Retrieving One's Roster on Login

   Upon connecting to the server and sending available presence, a
   client SHOULD request the roster before sending initial presence
   (however, because receiving the roster may not be desirable for all
   resources, e.g., a connection with limited bandwidth, the client's
   request for the roster is OPTIONAL).  If an available resource does
   not request the roster during a session, the server MUST NOT send it
   presence subscriptions and associated roster updates.  If an
   unavailable resource requests the roster, the server SHOULD return an
   <unexpected-request/> error to the resource.

Source:http://www.jabber.org/ietf/draft-ietf-xmpp-im-22.txt

So from reading this it appears unless you request a roster push when 
you login you will not recieve subscription requests.

-- 
http://randomthoughts.vandorp.ca/WK/blog





More information about the Twisted-Python mailing list