X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=account_cbs.pxd;h=06cd2cafd0586be0de017eb7c76244aee63333f4;hp=4f2e4be0742d192848fc0fe03d602b9bb95b5678;hb=refs%2Fheads%2Fmaster;hpb=e2eef524bf0c883406b15674eac0769c017d35c6
diff --git a/account_cbs.pxd b/account_cbs.pxd
index 4f2e4be..06cd2ca 100644
--- a/account_cbs.pxd
+++ b/account_cbs.pxd
@@ -17,46 +17,128 @@
# along with this program. If not, see .
#
-cimport purple
-
cdef extern from *:
ctypedef char const_char "const char"
account_cbs = {}
-cdef void notify_added(account.PurpleAccount *account, \
+cdef account.PurpleAccountRequestAuthorizationCb c_request_authorize_authorize_cb = NULL
+cdef account.PurpleAccountRequestAuthorizationCb c_request_authorize_deny_cb = NULL
+cdef void *c_request_authorize_user_data = NULL
+
+def call_authorize_cb():
+ global c_request_authorize_authorize_cb
+ global c_request_authorize_deny_cb
+ global c_request_authorize_user_data
+
+ if c_request_authorize_authorize_cb:
+ c_request_authorize_authorize_cb(c_request_authorize_user_data)
+ c_request_authorize_authorize_cb = NULL
+ c_request_authorize_deny_cb = NULL
+ c_request_authorize_user_data = NULL
+
+def call_deny_cb():
+ global c_request_authorize_authorize_cb
+ global c_request_authorize_deny_cb
+ global c_request_authorize_user_data
+
+ if c_request_authorize_deny_cb:
+ c_request_authorize_deny_cb(c_request_authorize_user_data)
+ c_request_authorize_authorize_cb = NULL
+ c_request_authorize_deny_cb = NULL
+ c_request_authorize_user_data = NULL
+
+cdef void notify_added(account.PurpleAccount *c_account, \
const_char *remote_user, const_char *id, const_char *alias, \
- const_char *message):
+ const_char *c_message):
"""
A buddy who is already on this account's buddy list added this account to
their buddy list.
"""
+ cdef connection.PurpleConnection *gc = \
+ account.purple_account_get_connection(c_account)
+
debug.purple_debug_info("account", "%s", "notify-added\n")
- if account_cbs.has_key("notify-added"):
- (