On 7/8/06, Lucas Nussbaum <[EMAIL PROTECTED]> wrote:
> On 07/07/06 at 13:24 +0200, David E Freitas wrote:
> > Hi,
> >
<snip>
>
> Hi,
>
> could you provide a patch for this, using 'svn diff' or directly 'diff' ?
>
> Thank you,
> --
> | Lucas Nussbaum
> | [EMAIL PROTECTED]   http://www.lucas-nussbaum.net/ |
> | jabber: [EMAIL PROTECTED]             GPG: 1024D/023B3F4F |
>


Hi Lucas,

I don't consider my changes as authoritive, so I do not want to
provide a patch.  I'd rather leave it for the main author to
incorporate the changes fully and as he sees best.

PyICQt and PyAIMt both have a <disableAvatars> config option.  I think
PyMSN should provide something similar too.

It's not that much that has to change, just a bunch of IF's have to be
scattered around. I thought I'd post some code to get the ball rolling
:)


Regards,

David

-----------------------------------------
www.defza.com
jabber: defza @ defza_com
From [EMAIL PROTECTED]  Sun Jul  9 13:38:01 2006
From: [EMAIL PROTECTED] (Alexey Nezhdanov)
Date: Sun Jul  9 13:38:09 2006
Subject: [py-transports] pymsnt 0.11 disabling avatars
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
        <[EMAIL PROTECTED]>
        <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>

On Sunday 09 July 2006 16:29, David E Freitas wrote:
> On 7/8/06, Lucas Nussbaum <[EMAIL PROTECTED]> wrote:
> > On 07/07/06 at 13:24 +0200, David E Freitas wrote:
> > > Hi,
> <snip>
> > Hi,
> >
> > could you provide a patch for this, using 'svn diff' or directly 'diff' ?
> >
> > Thank you,
> > --
> >
> > | Lucas Nussbaum
> > | [EMAIL PROTECTED]   http://www.lucas-nussbaum.net/ |
> > | jabber: [EMAIL PROTECTED]             GPG: 1024D/023B3F4F |
>
> Hi Lucas,
>
> I don't consider my changes as authoritive, so I do not want to
> provide a patch.  I'd rather leave it for the main author to
> incorporate the changes fully and as he sees best.
Just my 2 cents:
providing changes in incompartible format is equal to wasting others time. So 
ever if your changes not good enough for incorporating this is far from being 
good reason to force anybody (not even speaking about the author how usually 
very busy person) to manually copy-paste, search for typos and make other 
unpleasant stuff.
Typing 'svn diff | mail -s "my patch" [email protected]' is very 
fast and saves a lot of time both for patch analysis and for incorporation 
for reworking. You can ever use this snippet to do that.


-- 
Respectfully
Alexey Nezhdanov
From [EMAIL PROTECTED]  Mon Jul 10 15:18:06 2006
From: [EMAIL PROTECTED] (Matthew Anderson)
Date: Mon Jul 10 15:18:17 2006
Subject: [py-transports] pyAIMt bug, component to pyAIMt conversation
Message-ID: <[EMAIL PROTECTED]>

I've been struggling for about 4-5 days to successfully get a jabber  
component that I'm writing to successfully register an AIM screen  
name through pyAIMt.  I've definitely discovered a bug in pyAIMt  
which manifests itself as a TraceBack when pyAIMt receives a presence  
stanza it doesn't like.  But I know I *should* be able to get it to  
work, as I can register and use the AIM transport just fine through a  
jabber client (Psi, on OS X).

I've instrumented PyAIMt so I can see what's going in and out of the  
module, by adding in main.py of PyAIMt:

class PyTransport(component.Service):
        ...
        def componentConnected(self, xmlstream):
        ...
                self.xmlstream.addObserver("/[EMAIL 
PROTECTED]'http://etherx.jabber.org/ 
streams']", self.streamError)
                # my code starts here
                def print_wrap(f, tag):
                        def wrapped(*args, **kwds):
                                try:
                                        text = args[0].toXml()
                                except:
                                        text = args[0]
                                print "\n%s:"%tag, text
                                return f(*args, **kwds)
                        return wrapped
                self.xmlstream.send = print_wrap(self.xmlstream.send, "OUT")
                self.xmlstream.dataReceived = print_wrap 
(self.xmlstream.dataReceived, "IN")
                # my code ends here
                if config.useXCP and config.compjid:
                ...

And this seems to work great.

Below are two observed conversations with pyAIMt, the first is the  
broken version where I do not successfully finish registering and the  
TraceBack occurs in pyAIMt, and the second is a successful  
registration through the Psi jabber client.  Note that in the first /  
broken conversation, I actually emit three presence stanzas in  
sequence from my component, a subscribe, then a type-less (as in  
"available"), then a subscribed.  However, the input from the third  
emission (subscribed) does not show up in the conversation posted  
below.  I'm using pyxmpp to write my component, and if it seems  
relevant, the code in question is:

        p=Presence(stanza_type="subscribe", to_jid=from_jid, from_jid=to_jid)
        self.stream.send(p)
        p=Presence(to_jid=from_jid, from_jid=to_jid)
        self.stream.send(p)
        # this is in a block where I know I've received a "subscribe" message
        p=stanza.make_accept_response()
        self.stream.send(p)

If I comment out the sending of the type-less presence stanza, the  
traceback does not occur in pyAIMt (however, the registration process  
still doesn't work).

Help?  Please?  I'll settle for the moment on getting the process  
working with an ugly hack -- any idea on what I'm doing wrong?

Many thanks in advance.

<!-- =================== -->
<!-- Broken Conversation -->
<!-- =================== -->

IN: <iq xmlns='jabber:client' id='discover1' to='aim.bebop'  
from='group.bebop' type='get'>
   <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>

OUT: <iq from='aim.bebop' type='result' id='discover1'  
to='group.bebop'><query xmlns='http://jabber.org/protocol/ 
disco#info'><identity category='gateway' type='aim' name='AIM  
Transport'/><feature var='http://jabber.org/protocol/disco'/><feature  
var='jabber:iq:register'/><feature var='http://jabber.org/protocol/ 
commands'/><feature var='jabber:iq:gateway'/><feature  
var='jabber:iq:version'/><feature var='vcard-temp'/><feature  
var='jabber:iq:search'/></query></iq>

IN: <iq xmlns='jabber:client' id='require1' to='aim.bebop'  
from='group.bebop' type='get'>
   <query xmlns='jabber:iq:register'/>
</iq>

OUT: <iq to='group.bebop' from='aim.bebop' id='require1'  
type='result'><query xmlns='jabber:iq:register'><instructions>Please  
type your AIM screen name into the username field and your password.</ 
instructions><username/><password/></query></iq>

IN: <iq xmlns='jabber:client' id='reg [EMAIL PROTECTED]'  
to='aim.bebop' from='[EMAIL PROTECTED]' type='set'>
   <query xmlns='jabber:iq:register'>
     <username>CENSORED</username>
     <password>CENSORED</password>
   </query>
</iq>

OUT: <iq from='aim.bebop' type='result' id='reg [EMAIL PROTECTED]'  
to='[EMAIL PROTECTED]'/>

OUT: <presence to='[EMAIL PROTECTED]' from='aim.bebop'  
type='subscribe'><x xmlns='vcard-temp:x:update'/></presence>

IN: <presence xmlns='jabber:client' type='subscribe' to='aim.bebop'  
from='[EMAIL PROTECTED]'/>

OUT: <presence to='[EMAIL PROTECTED]' from='aim.bebop'  
type='unavailable'/>

IN: <presence xmlns='jabber:client' to='aim.bebop'  
from='[EMAIL PROTECTED]'/>

OUT: <iq to='[EMAIL PROTECTED]' from='aim.bebop' id='5'  
type='get'><vCard xmlns='vcard-temp'/></iq>

OUT: <presence to='[EMAIL PROTECTED]' from='aim.bebop'  
type='unavailable'><x xmlns='vcard-temp:x:update'/></presence>
Traceback (most recent call last):
   File "/usr/local/lib/python2.4/site-packages/twisted/internet/ 
pollreactor.py", line 145, in doPoll
     log.callWithLogger(selectable, _drdw, selectable, fd, event,  
POLLIN, POLLOUT, log)
   File "/usr/local/lib/python2.4/site-packages/twisted/python/ 
log.py", line 65, in callWithLogger
     callWithContext({"system": lp}, func, *args, **kw)
   File "/usr/local/lib/python2.4/site-packages/twisted/python/ 
log.py", line 52, in callWithContext
     return context.call({ILogContext: newCtx}, func, *args, **kw)
   File "/usr/local/lib/python2.4/site-packages/twisted/python/ 
context.py", line 43, in callWithContext
     return func(*args,**kw)
--- <exception caught here> ---
   File "/usr/local/lib/python2.4/site-packages/twisted/internet/ 
pollreactor.py", line 160, in _doReadOrWrite
     why = selectable.doRead()
   File "/usr/local/lib/python2.4/site-packages/twisted/internet/ 
tcp.py", line 255, in doRead
     return self.protocol.dataReceived(data)
   File "/usr/home/manderso/odi/aim2/pyaim-t-0.7d/src/main.py", line  
254, in wrapped
     return f(*args, **kwds)
   File "/usr/home/manderso/odi/aim2/pyaim-t-0.7d/src/tlib/ 
xmlstream.py", line 159, in dataReceived
     self.stream.parse(buf)
   File "/usr/home/manderso/odi/aim2/pyaim-t-0.7d/src/tlib/ 
domish.py", line 602, in parse
     self.parser.Parse(buffer)
   File "/usr/home/manderso/odi/aim2/pyaim-t-0.7d/src/tlib/ 
domish.py", line 639, in _onEndElement
     self.ElementEvent(self.currElem)
   File "/usr/home/manderso/odi/aim2/pyaim-t-0.7d/src/tlib/ 
xmlstream.py", line 180, in onElement
     self.dispatch(element)
   File "/usr/local/lib/python2.4/site-packages/twisted/xish/ 
utility.py", line 139, in dispatch
     callbacklist.callback(object)
   File "/usr/local/lib/python2.4/site-packages/twisted/xish/ 
utility.py", line 50, in callback
     methodwrapper(*args, **kwargs)
   File "/usr/local/lib/python2.4/site-packages/twisted/xish/ 
utility.py", line 34, in __call__
     self.method(*nargs, **nkwargs)
   File "/usr/home/manderso/odi/aim2/pyaim-t-0.7d/src/main.py", line  
381, in onPresence
     s.getCapabilities(el)
   File "/usr/home/manderso/odi/aim2/pyaim-t-0.7d/src/jabw.py", line  
236, in getCapabilities
     self.pytrans.discovery.sendIq(iq).addCallback(self.gotCapabilities)
exceptions.AttributeError: 'NoneType' object has no attribute  
'discovery'
wrapped xmlstream functions

IN: <iq xmlns='jabber:client' type='get' to='aim.bebop' from='bebop'  
id='dqvt26a9'><query xmlns='http://jabber.org/protocol/disco#info'/></ 
iq>

OUT: <iq from='aim.bebop' type='result' id='dqvt26a9'  
to='bebop'><query xmlns='http://jabber.org/protocol/ 
disco#info'><identity category='gateway' type='aim' name='AIM  
Transport'/><feature var='http://jabber.org/protocol/disco'/><feature  
var='jabber:iq:register'/><feature var='http://jabber.org/protocol/ 
commands'/><feature var='jabber:iq:gateway'/><feature  
var='jabber:iq:version'/><feature var='vcard-temp'/><feature  
var='jabber:iq:search'/></query></iq>


<!-- ==================== -->
<!-- Working Conversation -->
<!-- ==================== -->


IN: <iq xmlns='jabber:client' type='get' to='aim.bebop' id='aac5a'  
from='[EMAIL PROTECTED]/Psi'>
<query xmlns='jabber:iq:register'/>
</iq>

OUT: <iq to='[EMAIL PROTECTED]/Psi' from='aim.bebop' id='aac5a'  
type='result'><query xmlns='jabber:iq:register'><instructions>Please  
type your AIM screen name into the username field and your password.</ 
instructions><username/><password/></query></iq>

IN: <iq xmlns='jabber:client' type='set' to='aim.bebop' id='aac5a'  
from='[EMAIL PROTECTED]/Psi'>
<query xmlns='jabber:iq:register'>
<remove/>
</query>
</iq>

OUT: <iq xmlns='jabber:client'  to='[EMAIL PROTECTED]/Psi' type='error'  
id='aac5a' from='aim.bebop'>
<query xmlns='jabber:iq:register' >
<remove/>
</query>
<error type='wait'><internal-server-error  
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>

IN: <iq xmlns='jabber:client' type='get' to='aim.bebop' id='aac6a'  
from='[EMAIL PROTECTED]/Psi'>
<query xmlns='jabber:iq:register'/>
</iq>

OUT: <iq to='[EMAIL PROTECTED]/Psi' from='aim.bebop' id='aac6a'  
type='result'><query xmlns='jabber:iq:register'><instructions>Please  
type your AIM screen name into the username field and your password.</ 
instructions><username/><password/></query></iq>

IN: <iq xmlns='jabber:client' type='set' to='aim.bebop' id='aac7a'  
from='[EMAIL PROTECTED]/Psi'>
<query xmlns='jabber:iq:register'>
<username>CENSORED</username>
<password>CENSORED</password>
</query>
</iq>

OUT: <iq from='aim.bebop' type='result' id='aac7a' to='[EMAIL PROTECTED]/Psi'/>

OUT: <presence to='[EMAIL PROTECTED]' from='aim.bebop' type='subscribe'><x  
xmlns='vcard-temp:x:update'/></presence>

IN: <presence xmlns='jabber:client' type='subscribe' to='aim.bebop'  
from='[EMAIL PROTECTED]'/>

OUT: <presence to='[EMAIL PROTECTED]' from='aim.bebop' type='unavailable'/>

IN: <presence xmlns='jabber:client' from='[EMAIL PROTECTED]/Psi'  
to='aim.bebop'>
<x xmlns='jabber:x:delay' stamp='20060710T13:28:37' from='[EMAIL PROTECTED]/ 
Psi'/><priority>5</priority>
</presence>
<presence xmlns='jabber:client' type='subscribed' to='aim.bebop'  
from='[EMAIL PROTECTED]'/>

OUT: <iq to='[EMAIL PROTECTED]' from='aim.bebop' id='3' type='get'><vCard  
xmlns='vcard-temp'/></iq>

OUT: <iq from='aim.bebop' type='get' id='4' to='[EMAIL PROTECTED]/ 
Psi'><query xmlns='http://jabber.org/protocol/disco#info'/></iq>

IN: <iq xmlns='jabber:client' type='result' to='aim.bebop'  
from='[EMAIL PROTECTED]' id='3'><vCard xmlns='vcard-temp'/></iq>

IN: <iq xmlns='jabber:client' type='result' to='aim.bebop' id='4'  
from='[EMAIL PROTECTED]/Psi'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<feature var='http://jabber.org/protocol/bytestreams'/>
<feature var='http://jabber.org/protocol/si'/>
<feature var='http://jabber.org/protocol/si/profile/file-transfer'/>
</query>
</iq>

OUT: <presence to='[EMAIL PROTECTED]' from='[EMAIL PROTECTED]'  
type='unavailable'><x xmlns='vcard- 
temp:x:update'><photo>5248ab7f0c7b1ed9ae99c21d6247ef5a28af5117</ 
photo><nickname>manderso4aim</nickname></x><x  
xmlns='jabber:x:avatar'><hash>5248ab7f0c7b1ed9ae99c21d6247ef5a28af5117</ 
hash></x><c node='http://pyaim-t.blathersource.org/protocol/caps'  
xmlns='http://jabber.org/protocol/caps' ver='0.7d'/></presence>

OUT: <presence to='[EMAIL PROTECTED]' from='[EMAIL PROTECTED]'  
type='subscribe'><x xmlns='http://jabber.org/protocol/roster- 
subsync'><item name='manderso4aim' subscription='both'/></x></presence>

OUT: <presence to='[EMAIL PROTECTED]' from='aim.bebop'><x xmlns='vcard- 
temp:x:update'/></presence>

IN: <presence xmlns='jabber:client' type='subscribed'  
from='[EMAIL PROTECTED]' to='[EMAIL PROTECTED]'><x xmlns='http:// 
jabber.org/protocol/roster-subsync'><item subscription='both'  
name='manderso4aim'/></x></presence>

IN: <presence xmlns='jabber:client' from='[EMAIL PROTECTED]/Psi'  
to='[EMAIL PROTECTED]'>
<x xmlns='jabber:x:delay' stamp='20060710T13:28:37' from='[EMAIL PROTECTED]/ 
Psi'/><priority>5</priority>
</presence>

--
  Matt Anderson


Reply via email to