X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=signal_cbs.pxd;h=9d9a0786c00f7ad382552476c059995926b06679;hb=HEAD;hp=8155b745634759f90cadc8490035ed3e1eedb51d;hpb=445c387d8067391f329186a13ce482dbb3c64c80;p=python-purple
diff --git a/signal_cbs.pxd b/signal_cbs.pxd
index 8155b74..9d9a078 100644
--- a/signal_cbs.pxd
+++ b/signal_cbs.pxd
@@ -17,56 +17,194 @@
# along with this program. If not, see .
#
-cimport purple
-
signal_cbs = {}
-cdef void signal_buddy_signed_off_cb (blist.PurpleBuddy *buddy):
+cdef extern from *:
+ ctypedef char const_gchar "const gchar"
+
+cdef void signal_signed_on_cb(connection.PurpleConnection *gc, \
+ glib.gpointer null):
+ """
+ Emitted when a connection has signed on.
+ @params gc The connection that has signed on.
+ """
+ cdef account.PurpleAccount *acc = connection.purple_connection_get_account(gc)
+ cdef char *c_username = NULL
+ cdef char *c_protocol_id = NULL
+
+ c_username = account.purple_account_get_username(acc)
+ if c_username == NULL:
+ username = None
+ else:
+ username = c_username
+
+ c_protocol_id = account.purple_account_get_protocol_id(acc)
+ if c_protocol_id == NULL:
+ protocol_id = None
+ else:
+ protocol_id = c_protocol_id
+
+ if "signed-on" in signal_cbs:
+ (