Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Example 27: Add a disconnect_xmpp method to clean up.

This will be called both on window closing and if login is unsuccessful.
  • Loading branch information...
commit 22017b9e36f703b3ca52c08542128b3bca2ac4d1 1 parent e9a5f8c
Dusty Phillips authored July 04, 2013

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. 6  orkiv/__main__.py
6  orkiv/__main__.py
@@ -76,4 +76,10 @@ def connect_to_jabber(self, jabber_id, password):
76 76
         self.xmpp.send_presence()
77 77
         self.xmpp.get_roster()
78 78
 
  79
+    def disconnect_xmpp(self):
  80
+        if self.xmpp and self.xmpp.state.ensure("connected"):
  81
+            self.xmpp.abort()
  82
+        self.xmpp = None
  83
+
  84
+
79 85
 Orkiv().run()

0 notes on commit 22017b9

Please sign in to comment.
Something went wrong with that request. Please try again.