From 1851ab6f5fe3548eccbc118bdb71340ee92dd9da Mon Sep 17 00:00:00 2001 From: Sandro Munda Date: Thu, 7 Jun 2012 19:24:23 +0200 Subject: [PATCH] Added the SID in the socks_recv xmpp event in the xep_0065 plugin. --- sleekxmpp/plugins/xep_0065/proxy.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sleekxmpp/plugins/xep_0065/proxy.py b/sleekxmpp/plugins/xep_0065/proxy.py index f950b6aa..60b7d6ed 100644 --- a/sleekxmpp/plugins/xep_0065/proxy.py +++ b/sleekxmpp/plugins/xep_0065/proxy.py @@ -214,6 +214,12 @@ class xep_0065(base_plugin): def on_recv(self, sid, data): """ Calls when data is recv from the Proxy socket associated to the SID. + + Triggers a socks_closed event if the socket is closed. The sid + is passed to this event. + + Triggers a socks_recv event if there's available data. A dict + that contains the sid and the data is passed to this event. """ proxy = self.proxy_threads.get(sid) @@ -221,7 +227,7 @@ class xep_0065(base_plugin): if not data: self.xmpp.event('socks_closed', sid) else: - self.xmpp.event('socks_recv', data) + self.xmpp.event('socks_recv', {'sid': sid, 'data': data}) class Proxy(Thread):