Re: XMPP xmpppy - User Authorization

2008-12-13 Thread Henson
In my own bot, using the latest xmpppy, I've been printing everything
going to the message handler to the screen.  I've yet to see a
'subscribe' string.  Has this changed?


James Mills wrote:
> On Wed, Nov 5, 2008 at 11:28 AM, James Mills
>  wrote:
> > Can anyone shed any light on how I might
> > be able to react to "User Authorization Requests"
> > from other users on an XMPP server/network
> > using teh xmlpp [1] library ?
>
> [SOLVED}:
>
> I found out from having a peek at jabberbot [1]
> that it was as simple as parsing the message.
>
> Here's a code snippet:
>
> 
>def messageHandler(self, cnx, message):
>   text = message.getBody()
>   user = message.getFrom()
>
>   if text is not None:
>  self.env.log.debug("<%s> %s" % (user, text))
>
>  if " " in text:
> command, args = text.split(" ", 1)
>  else:
> command, text = text, ""
>
>  command = command.upper()
>
>  if command == "SUBSCRIBE":
> self._client.Roster.Authorize(user)
> reply = "Authorized."
> 
>
> --JamesMills
>
> --
> --
> -- "Problems are solved by method"
--
http://mail.python.org/mailman/listinfo/python-list


Re: XMPP xmpppy - User Authorization

2008-12-15 Thread Henson
On Dec 14, 4:23 am, "James Mills" 
wrote:
> On Sun, Dec 14, 2008 at 3:47 PM, Henson  wrote:
> > In my own bot, using the latestxmpppy, I've been printing everything
> > going to the message handler to the screen.  I've yet to see a
> > 'subscribe' string.  Has this changed?
>
> No this hasn't changed. This is the string you need
> to check for. It does work :)
>
> cheers
> James
>
>
>
> --
> -- "Problems are solved by method"

Found it.  To me, the 'subscribe' was coming in through the Presence
handler, not the Message handler.

Thanks for the heads up,

- Henson
--
http://mail.python.org/mailman/listinfo/python-list