2 # Copyright (c) 2008 INdT - Instituto Nokia de Tecnologia
4 # This file is part of python-purple.
6 # python-purple is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # python-purple is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 cdef void connect_progress (connection.PurpleConnection *gc, const_char *text,
28 size_t step, size_t step_count):
29 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection",
32 (<object>connection_cbs["connect-progress"])(<char *>text, step, step_count)
36 cdef void connected (connection.PurpleConnection *gc):
37 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection",
40 (<object>connection_cbs["connected"])("connected: TODO")
44 cdef void disconnected (connection.PurpleConnection *gc):
45 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection",
48 (<object>connection_cbs["disconnected"])("disconnected: TODO")
52 cdef void notice (connection.PurpleConnection *gc, const_char *text):
53 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection",
56 (<object>connection_cbs["notice"])("notice: TODO")
60 cdef void report_disconnect (connection.PurpleConnection *gc,
62 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection",
63 "report-disconnect\n")
65 (<object>connection_cbs["report-disconnect"])(<char *>text)
69 cdef void network_connected ():
70 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection",
71 "network-connected\n")
73 (<object>connection_cbs["network-connected"])("network-connected: TODO")
77 cdef void network_disconnected ():
78 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection",
79 "network-disconnected\n")
81 (<object>connection_cbs["network-disconnected"])("network-disconnected: TODO")
85 cdef void report_disconnect_reason (connection.PurpleConnection *gc,
86 connection.PurpleConnectionError reason,
88 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "connection",
89 "report-disconnect-reason\n")
93 1: 'Invalid username',
94 2: 'Authentication failed',
95 3: 'Authentication impossible',
97 5: 'Encryption error',
99 7: 'Invalid settings',
100 8: 'Certificate not provided',
101 9: 'Certificate untrusted',
102 10: 'Certificate expired',
103 11: 'Certificate not activated',
104 12: 'Certificate hostname mismatch',
105 13: 'Certificate fingerprint mismatch',
106 14: 'Certificate self signed',
107 15: 'Certificate error (other)',
108 16: 'Other error' }[reason]
111 (<object>connection_cbs["report-disconnect-reason"])(reason_string, <char *>text)