By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,525 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,525 IT Pros & Developers. It's quick & easy.

Re: XMPP xmpppy - User Authorization

P: n/a
On Wed, Nov 5, 2008 at 11:28 AM, James Mills
<pr******@shortcircuit.net.auwrote:
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:

<code>
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."
</code>

--JamesMills

--
--
-- "Problems are solved by method"
Nov 5 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.