X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=connection_cbs.pxd;h=1fc35d609f7aeac73dd7023b3495116f5f6c5cad;hp=b30016eabcbb0ec126338eb382be0c8689e7c400;hb=d498550db3bfd489d8319e7342cc10b76cf24ac9;hpb=3d9932a4f305fc45e781e6d1620a864f569f3556 diff --git a/connection_cbs.pxd b/connection_cbs.pxd index b30016e..1fc35d6 100644 --- a/connection_cbs.pxd +++ b/connection_cbs.pxd @@ -34,7 +34,7 @@ cdef void connect_progress(connection.PurpleConnection *gc, const_char *text, \ of what is happening, as well as which a step out of step_count has been reached (which might be displayed as a progress bar). """ - debug.c_purple_debug_info("connection", "%s", "connect-progress\n") + debug.purple_debug_info("connection", "%s", "connect-progress\n") if connection_cbs.has_key("connect-progress"): ( connection_cbs["connect-progress"])( text, step, step_count) @@ -42,7 +42,7 @@ cdef void connected(connection.PurpleConnection *gc): """ Called when a connection is established (just before the signed-on signal). """ - debug.c_purple_debug_info("connection", "%s", "connected\n") + debug.purple_debug_info("connection", "%s", "connected\n") if connection_cbs.has_key("connected"): ( connection_cbs["connected"])("connected: TODO") @@ -51,7 +51,7 @@ cdef void disconnected(connection.PurpleConnection *gc): Called when a connection is ended (between the signing-off and signed-off signal). """ - debug.c_purple_debug_info("connection", "%s", "disconnected\n") + debug.purple_debug_info("connection", "%s", "disconnected\n") if connection_cbs.has_key("disconnected"): ( connection_cbs["disconnected"])("disconnected: TODO") @@ -61,7 +61,7 @@ cdef void notice(connection.PurpleConnection *gc, const_char *text): implements this as a no-op; purple_connection_notice(), which uses this operation, is not used by any of the protocols shipped with libpurple.) """ - debug.c_purple_debug_info("connection", "%s", "notice\n") + debug.purple_debug_info("connection", "%s", "notice\n") if connection_cbs.has_key("notice"): ( connection_cbs["notice"])("notice: TODO") @@ -74,7 +74,7 @@ cdef void report_disconnect(connection.PurpleConnection *gc, const_char *text): @deprecated in favour of PurpleConnectionUiOps.report_disconnect_reason. """ - debug.c_purple_debug_info("connection", "%s", "report-disconnect\n") + debug.purple_debug_info("connection", "%s", "report-disconnect\n") if connection_cbs.has_key("report-disconnect"): ( connection_cbs["report-disconnect"])( text) @@ -84,7 +84,7 @@ cdef void network_connected(): is active. On Linux, this uses Network Manager if available; on Windows, it uses Win32's network change notification infrastructure. """ - debug.c_purple_debug_info("connection", "%s", "network-connected\n") + debug.purple_debug_info("connection", "%s", "network-connected\n") if connection_cbs.has_key("network-connected"): ( connection_cbs["network-connected"])() @@ -93,12 +93,12 @@ cdef void network_disconnected(): Called when libpurple discovers that the computer's network connection has gone away. """ - debug.c_purple_debug_info("connection", "%s", "network-disconnected\n") + debug.purple_debug_info("connection", "%s", "network-disconnected\n") if connection_cbs.has_key("network-disconnected"): ( connection_cbs["network-disconnected"])() cdef void report_disconnect_reason(connection.PurpleConnection *gc, \ - connection.PurpleConnectionError reason, const_char *text): + connection.PurpleConnectionError reason, const_char *c_text): """ Called when an error causes a connection to be disconnected. Called before disconnected. This op is intended to replace report_disconnect. @@ -111,7 +111,7 @@ cdef void report_disconnect_reason(connection.PurpleConnection *gc, \ @see purple_connection_error_reason @since 2.3.0 """ - debug.c_purple_debug_info("connection", "%s", "report-disconnect-reason\n") + debug.purple_debug_info("connection", "%s", "report-disconnect-reason\n") reason_string = { 0: 'Network error', @@ -132,5 +132,10 @@ cdef void report_disconnect_reason(connection.PurpleConnection *gc, \ 15: 'Certificate error (other)', 16: 'Other error' }[reason] + if c_text: + text = c_text + else: + text = None + if connection_cbs.has_key("report-disconnect-reason"): ( connection_cbs["report-disconnect-reason"])(reason_string, text)