[ejabberd] Re: Py*-t and ejabberd?

Daniel Henninger jadestorm at nc.rr.com
Sat Dec 25 20:02:56 MSK 2004


Woohoo!  This will be applied to the next release of PyICQ and PyAIM!  I
forwarded this to James (of PyMSN) as well!  Thanks!

Daniel

-- 
"The most addictive drug in the world is music."
     - The Lost Boyz

> I think I found the problem.  ejabberd doesn't handle subscription
> requests addressed to a JID with resource (foo at example.com/bar as
> opposed to foo at example.com), but that's what Py*-t sends when a user
> registers.
>
> Section 5.1.6 of RFC 3921 says:
>
> "If the subscription request is being sent to an instant messaging
> contact, the JID supplied in the 'to' attribute SHOULD be of the form
> <contact at example.org> rather than <contact at example.org/resource>"
>
> To me, it seems to mean that both ejabberd and PyICQ-t are conforming
> to the standard, but still can't interoperate...
>
> Here's a patch for PyICQ-t that fixes the problem.  I think ejabberd
> should be fixed too, but I'm not quite sure how to do that.
>
> --- orig/src/register.py
> +++ mod/src/register.py
> @@ -130,7 +130,9 @@
>  				debug.log("RegisterManager: Sent off a result Iq")
>  				# If they're in a session right now, we do nothing
>  				if(not self.pytrans.sessions.has_key(source)):
> -					jabw.sendPresence(self.pytrans, to=incoming.getAttribute("from"),
> fro=config.jid, ptype="subscribe")
> +					# strip resource
> +					(user,host,_) = jid.parse(incoming.getAttribute("from"))
> +					jabw.sendPresence(self.pytrans, to=("%s@%s" % (user,host)),
> fro=config.jid, ptype="subscribe")
>  			except:
>  				self.xdbErrorReply(incoming)
>  				raise
>
>
> Magnus
>
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
>
>



More information about the ejabberd mailing list