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_info("connection", "%s", "connect-progress\n")
31 (<object>connection_cbs["connect-progress"])(<char *>text, step, step_count)
35 cdef void connected (connection.PurpleConnection *gc):
36 debug.c_purple_debug_info("connection", "%s", "connected\n")
38 (<object>connection_cbs["connected"])("connected: TODO")
42 cdef void disconnected (connection.PurpleConnection *gc):
43 debug.c_purple_debug_info("connection", "%s", "disconnected\n")
45 (<object>connection_cbs["disconnected"])("disconnected: TODO")
49 cdef void notice (connection.PurpleConnection *gc, const_char *text):
50 debug.c_purple_debug_info("connection", "%s", "notice\n")
52 (<object>connection_cbs["notice"])("notice: TODO")
56 cdef void report_disconnect (connection.PurpleConnection *gc,
58 debug.c_purple_debug_info("connection", "%s", "report-disconnect\n")
60 (<object>connection_cbs["report-disconnect"])(<char *>text)
64 cdef void network_connected ():
65 debug.c_purple_debug_info("connection", "%s", "network-connected\n")
67 (<object>connection_cbs["network-connected"])("network-connected: TODO")
71 cdef void network_disconnected ():
72 debug.c_purple_debug_info("connection", "%s", "network-disconnected\n")
74 (<object>connection_cbs["network-disconnected"])("network-disconnected: TODO")
78 cdef void report_disconnect_reason (connection.PurpleConnection *gc,
79 connection.PurpleConnectionError reason,
81 debug.c_purple_debug_info("connection", "%s", "report-disconnect-reason\n")
85 1: 'Invalid username',
86 2: 'Authentication failed',
87 3: 'Authentication impossible',
89 5: 'Encryption error',
91 7: 'Invalid settings',
92 8: 'Certificate not provided',
93 9: 'Certificate untrusted',
94 10: 'Certificate expired',
95 11: 'Certificate not activated',
96 12: 'Certificate hostname mismatch',
97 13: 'Certificate fingerprint mismatch',
98 14: 'Certificate self signed',
99 15: 'Certificate error (other)',
100 16: 'Other error' }[reason]
103 (<object>connection_cbs["report-disconnect-reason"])(reason_string, <char *>text)