[sugar] review: gadget presence branch

Guillaume Desmottes guillaume.desmottes
Fri May 16 06:31:07 EDT 2008


Le jeudi 15 mai 2008 ? 21:57 +0100, Dafydd Harries a ?crit :
> > +        # FIXME: we should send presence to buddies subscribed to gadget. How?
> >          if self.debug:
> >              self.xmlstream.setDispatchFn(self.onElement)
> >  
> 
> I'm guessing your roster branch answers this question.
> 

yep

> > @@ -235,6 +236,9 @@ class GadgetService(component.Service):
> >      def presence(self, stanza):
> >          type = stanza.getAttribute('type')
> >          from_ = stanza.getAttribute('from')
> > +        # remove the ressource
> > +        jid = from_.split('/')[0]
> > +        to = stanza.getAttribute('to')
> >  
> >          if from_ is None:
> >              return
> 
> Twisted has code for handling JIDs; let's use that.
> 
>   >>> from twisted.words.protocols.jabber import jid
>   >>> jid.JID('foo at bar/baz').userhost()
>   'foo at bar'
> 

Good catch fixed.



> Looks great otherwise. Please merge!
> 

merged.
Thanks for the review.


	G.





More information about the Sugar-devel mailing list