[Telepathy-commits] [telepathy-salut/master] xmppstream.py: add IncomingXmppiChatStream class

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Nov 28 04:35:39 PST 2008


---
 tests/twisted/xmppstream.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/twisted/xmppstream.py b/tests/twisted/xmppstream.py
index b8c826c..572af6f 100644
--- a/tests/twisted/xmppstream.py
+++ b/tests/twisted/xmppstream.py
@@ -105,7 +105,8 @@ class IncomingXmppStream(BaseXmlStream):
 
         assert rootElement.hasAttribute("from")
         assert rootElement.hasAttribute("to")
-        assert rootElement["to"] == self.name, self.name
+        if self.name is not None:
+            assert rootElement["to"] == self.name, self.name
 
         assert rootElement.hasAttribute("version")
         assert rootElement["version"] == "1.0"
@@ -150,10 +151,15 @@ class OutgoingXmppStream(BaseXmlStream):
 
 class OutgoingXmppiChatStream(OutgoingXmppStream):
     def __init__(self, event_function, name, remote_name):
-        # name and remote_name as None as iChat doesn't send 'to' and
+        # set name and remote_name as None as iChat doesn't send 'to' and
         # 'from' attributes.
         OutgoingXmppStream.__init__(self, event_function, None, None)
 
+class IncomingXmppiChatStream(IncomingXmppStream):
+    def __init__(self, event_func, name):
+        # set name to None as iChat doesn't send 'from' attribute.
+        IncomingXmppStream.__init__(self, event_func, None)
+
 class OutgoingXmppFactory(ClientFactory):
     def __init__(self, event_function):
         self.event_func = event_function
-- 
1.5.6.5




More information about the Telepathy-commits mailing list