]> code.delx.au - pymsnt/blobdiff - src/main.py
Made no reactor error a bit clearer.
[pymsnt] / src / main.py
index a2a5b105c9cca7efe9ea7da13b25626b2d345b3c..eb90dd4e467c6951346c9ab3a3697f9cb7a393b4 100644 (file)
@@ -25,7 +25,7 @@ except:
                                        from twisted.internet import default as bestreactor
                                        print selectWarning
                                except:
-                                       print "Unable to find a reactor.\nExiting..."
+                                       print "Unable to find a reactor. Please make sure you have Twisted properly installed.\nExiting..."
                                        sys.exit(1)
 bestreactor.install()
 
@@ -304,16 +304,19 @@ class PyTransport(component.Service):
                        
                        elif ptype and (ptype.startswith("subscribe") or ptype.startswith("unsubscribe")):
                                # They haven't logged in, and are trying to change subscription to a user
+                               # No, lets not log them in. Lets send an error :)
+                               jabw.sendPresence(self, fro, to, ptype="error")
+                               
                                # Lets log them in and then do it
-                               LogEvent(INFO, "", "Attempting to create a session to do subscription stuff.")
-                               s = session.makeSession(self, froj.userhost(), ulang)
-                               if s:
-                                       self.sessions[froj.userhost()] = s
-                                       LogEvent(INFO, "", "New session created.")
-                                       # Tell the session there's a new resource
-                                       s.handleResourcePresence(froj.userhost(), froj.resource, toj.userhost(), toj.resource, 0, None, None, None)
-                                       # Send this subscription
-                                       s.onPresence(el)
+                               #LogEvent(INFO, "", "Attempting to create a session to do subscription stuff.")
+                               #s = session.makeSession(self, froj.userhost(), ulang)
+                               #if s:
+                               #       self.sessions[froj.userhost()] = s
+                               #       LogEvent(INFO, "", "New session created.")
+                               #       # Tell the session there's a new resource
+                               #       s.handleResourcePresence(froj.userhost(), froj.resource, toj.userhost(), toj.resource, 0, None, None, None)
+                               #       # Send this subscription
+                               #       s.onPresence(el)
 
 
 class App: