X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=connection.pyx;h=19da89130088a7ac33d04232110ee82e895883ea;hp=1531059d250299ee81e88b57f5f789b1b3eae655;hb=f0ff8c3ffbd828fbdc0963c8c4744c94363f40a7;hpb=7f9bbfa5e0f087ba5a5c1367ab1bea72f53573d0 diff --git a/connection.pyx b/connection.pyx index 1531059..19da891 100644 --- a/connection.pyx +++ b/connection.pyx @@ -17,9 +17,21 @@ # along with this program. If not, see . # +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, signed_on_cb, NULL)