Added initial support for new_node, update and remove callbacks from PurpleBlistUiOps.
[python-purple] / connection.pyx
index 1531059..19da891 100644 (file)
 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+cimport purple
+
+cdef void signed_on_cb (connection.PurpleConnection *gc, glib.gpointer null):
+    cdef account.PurpleAccount *acc = connection.c_purple_connection_get_account(gc)
+    print "Account connected: %s %s" % (acc.username, acc.protocol_id)
+
 cdef class Connection:
     """ Connection class """
-    cdef PurpleConnection *__conn
+    cdef connection.PurpleConnection *__conn
+
+    def __init__(self):
+        pass
 
     def connect(self):
-        connect_to_signals_for_demonstration_purposes_only()
+        cdef int handle
+
+        signals.c_purple_signal_connect(connection.c_purple_connections_get_handle(),
+            "signed-on", &handle, <signals.PurpleCallback> signed_on_cb, NULL)