Fixed definition of union inside PurplePresence structure, added missing structure...
[python-purple] / connection.pyx
index 2e9a8f4..19da891 100644 (file)
 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-cimport connection
+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 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)