Updated report_disconnect_reason callback.
authorRagner Magalhaes <ragner.magalhaes@openbossa.org>
Tue, 2 Dec 2008 21:24:24 +0000 (21:24 +0000)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Sat, 28 Feb 2009 21:11:21 +0000 (17:11 -0400)
FIXES:
 - Updated report_disconnect_reason callback.

Signed-off-by: Bruno Abinader <bruno.abinader@openbossa.org>
Acked-by: Fred Duarte <fred.duarte@openbossa.org>

git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1456 596f6dd7-e928-0410-a184-9e12fd12cf7e

connection_cbs.pxd

index 463b17a..1fc35d6 100644 (file)
@@ -98,7 +98,7 @@ cdef void network_disconnected():
         (<object> connection_cbs["network-disconnected"])()
 
 cdef void report_disconnect_reason(connection.PurpleConnection *gc, \
         (<object> 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.
     """
     Called when an error causes a connection to be disconnected. Called
     before disconnected. This op is intended to replace report_disconnect.
@@ -132,5 +132,10 @@ cdef void report_disconnect_reason(connection.PurpleConnection *gc, \
         15: 'Certificate error (other)',
         16: 'Other error' }[reason]
 
         15: 'Certificate error (other)',
         16: 'Other error' }[reason]
 
+    if c_text:
+        text = <char *> c_text
+    else:
+        text = None
+
     if connection_cbs.has_key("report-disconnect-reason"):
         (<object> connection_cbs["report-disconnect-reason"])(reason_string, <char *> text)
     if connection_cbs.has_key("report-disconnect-reason"):
         (<object> connection_cbs["report-disconnect-reason"])(reason_string, <char *> text)