X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=account_cbs.pxd;h=d314040f6d910f5b602849b07a4b752396334bd6;hp=8f8a800f87e0043b2ec9717a9369e3d4ec7fce0e;hb=7b635b4096c7de4b55ac0026be6b49be85f453a1;hpb=b6228086f86fb49fb290e50f7a143a687b7d3fff diff --git a/account_cbs.pxd b/account_cbs.pxd index 8f8a800..d314040 100644 --- a/account_cbs.pxd +++ b/account_cbs.pxd @@ -50,16 +50,41 @@ def call_deny_cb(): c_request_authorize_deny_cb = NULL c_request_authorize_user_data = NULL -cdef void notify_added(account.PurpleAccount *account, \ +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 alias: + remote_alias = alias + else: + remote_alias = None + + if id: + username = id + elif connection.purple_connection_get_display_name(gc) != NULL: + username = connection.purple_connection_get_display_name(gc) + else: + username = account.purple_account_get_username(c_account) + + protocol_id = account.purple_account_get_protocol_id(c_account) + + if c_message: + message = c_message + else: + message = None + if account_cbs.has_key("notify-added"): - ( account_cbs["notify-added"])("notify-added: TODO") + ( account_cbs["notify-added"])( \ + ( remote_user, remote_alias), \ + (username, protocol_id), message) cdef void status_changed(account.PurpleAccount *account, \ status.PurpleStatus *status):