X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=connection_cbs.pxd;h=ea707e6aee9a38a9b042948cdf00529723d70957;hp=58b58adb3b2802734b4ac2a148b96287a50962e9;hb=6ad4afacade908a5195e9b0e12c118d62e8a53ae;hpb=4c0c79b5e686d123a21bd4b4cdc356782f0b24c8 diff --git a/connection_cbs.pxd b/connection_cbs.pxd index 58b58ad..ea707e6 100644 --- a/connection_cbs.pxd +++ b/connection_cbs.pxd @@ -29,7 +29,7 @@ cdef void connect_progress (connection.PurpleConnection *gc, const_char *text, debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection", "connect_progress\n") try: - (connection_cbs["connect_progress"])("connect_progress") + (connection_cbs["connect_progress"])(text, step, step_count) except KeyError: pass @@ -37,7 +37,7 @@ cdef void connected (connection.PurpleConnection *gc): debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection", "connected\n") try: - (connection_cbs["connected"])("connected") + (connection_cbs["connected"])() except KeyError: pass @@ -45,7 +45,7 @@ cdef void disconnected (connection.PurpleConnection *gc): debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection", "disconnected\n") try: - (connection_cbs["disconnected"])("disconnected") + (connection_cbs["disconnected"])() except KeyError: pass @@ -62,7 +62,7 @@ cdef void report_disconnect (connection.PurpleConnection *gc, debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection", "report_disconnect\n") try: - (connection_cbs["report_disconnect"])("report_disconnect") + (connection_cbs["report_disconnect"])(text) except KeyError: pass @@ -87,7 +87,27 @@ cdef void report_disconnect_reason (connection.PurpleConnection *gc, const_char *text): debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection", "report_disconnect_reason\n") + + reason_string = { + 0: 'Network error', + 1: 'Invalid username', + 2: 'Authentication failed', + 3: 'Authentication impossible', + 4: 'No SSL support', + 5: 'Encryption error', + 6: 'Name in use', + 7: 'Invalid settings', + 8: 'Certificate not provided', + 9: 'Certificate untrusted', + 10: 'Certificate expired', + 11: 'Certificate not activated', + 12: 'Certificate hostname mismatch', + 13: 'Certificate fingerprint mismatch', + 14: 'Certificate self signed', + 15: 'Certificate error (other)', + 16: 'Other error' }[reason] + try: - (connection_cbs["report_disconnect_reason"])("report_disconnect_reason") + (connection_cbs["report_disconnect_reason"])(reason_string, text) except KeyError: pass