From: Ragner Magalhaes Date: Tue, 2 Dec 2008 21:25:42 +0000 (+0000) Subject: Updated add_buddy on Account class. X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=commitdiff_plain;h=84a8f650634180df817b3c50ffd2f226b7cf3061 Updated add_buddy on Account class. FIXES: - Updated add_buddy on Account class. - Added libpurple/server.pxd. Signed-off-by: Bruno Abinader Acked-by: Ricardo Guimaraes git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1459 596f6dd7-e928-0410-a184-9e12fd12cf7e --- diff --git a/account.pyx b/account.pyx index db56e2c..5656405 100644 --- a/account.pyx +++ b/account.pyx @@ -469,6 +469,10 @@ cdef class Account: blist.purple_blist_add_buddy(c_buddy, NULL, c_group, NULL) account.purple_account_add_buddy(self._get_structure(), c_buddy) + if c_alias: + blist.purple_blist_alias_buddy(c_buddy, c_alias) + server.serv_alias_buddy(c_buddy) + return True else: diff --git a/libpurple/prpl.pxd b/libpurple/prpl.pxd index be305ac..df011ad 100644 --- a/libpurple/prpl.pxd +++ b/libpurple/prpl.pxd @@ -27,5 +27,7 @@ cdef extern from "libpurple/prpl.h": ctypedef struct PurplePluginProtocolInfo: glib.GList *protocol_options + ctypedef struct PurpleAttentionType + # Protocol Plugin Subsystem API PurplePlugin *purple_find_prpl(char *id) diff --git a/libpurple/purple.pxd b/libpurple/purple.pxd index e7a76cb..cc9029b 100644 --- a/libpurple/purple.pxd +++ b/libpurple/purple.pxd @@ -39,6 +39,7 @@ cimport proxy cimport prpl cimport request cimport roomlist +cimport server cimport signals cimport status cimport savedstatuses diff --git a/libpurple/server.pxd b/libpurple/server.pxd new file mode 100644 index 0000000..6122f1e --- /dev/null +++ b/libpurple/server.pxd @@ -0,0 +1,86 @@ +# +# Copyright (c) 2008 INdT - Instituto Nokia de Tecnologia +# +# This file is part of python-purple. +# +# python-purple is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# python-purple is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +cimport glib + +cimport account +cimport blist +cimport connection +cimport conversation +cimport prpl + +cdef extern from *: + ctypedef char const_char "const char" + ctypedef long int time_t + +cdef extern from "libpurple/server.h": + unsigned int serv_send_typing(connection.PurpleConnection *gc, \ + const_char *name, conversation.PurpleTypingState state) + void serv_move_buddy(blist.PurpleBuddy *, blist.PurpleGroup *, \ + blist.PurpleGroup *) + int serv_send_im(connection.PurpleConnection *, const_char *, \ + const_char *, conversation.PurpleMessageFlags flags) + prpl.PurpleAttentionType *purple_get_attention_type_from_code( \ + account.PurpleAccount *account, glib.guint type_code) + void serv_send_attention(connection.PurpleConnection *gc, \ + const_char *who, glib.guint type_code) + void serv_got_attention(connection.PurpleConnection *gc, \ + const_char *who, glib.guint type_code) + void serv_get_info(connection.PurpleConnection *, const_char *) + void serv_set_info(connection.PurpleConnection *, const_char *) + void serv_add_permit(connection.PurpleConnection *, const_char *) + void serv_add_deny(connection.PurpleConnection *, const_char *) + void serv_rem_permit(connection.PurpleConnection *, const_char *) + void serv_rem_deny(connection.PurpleConnection *, const_char *) + void serv_set_permit_deny(connection.PurpleConnection *) + void serv_chat_invite(connection.PurpleConnection *, int, \ + const_char *, const_char *) + void serv_chat_leave(connection.PurpleConnection *, int) + void serv_chat_whisper(connection.PurpleConnection *, int, \ + const_char *, const_char *) + int serv_chat_send(connection.PurpleConnection *, int, const_char *, \ + conversation.PurpleMessageFlags flags) + void serv_alias_buddy(blist.PurpleBuddy *) + void serv_got_alias(connection.PurpleConnection *gc, const_char *who, \ + const_char *alias) + void purple_serv_got_private_alias(connection.PurpleConnection *gc, \ + const_char *who, const_char *alias) + + void serv_got_typing(connection.PurpleConnection *gc, const_char *name, \ + int timeout, conversation.PurpleTypingState state) + void serv_got_typing_stopped(connection.PurpleConnection *gc, \ + const_char *name) + void serv_got_im(connection.PurpleConnection *gc, const_char *who, \ + const_char *msg, conversation.PurpleMessageFlags flags, \ + time_t mtime) + void serv_join_chat(connection.PurpleConnection *, glib.GHashTable *data) + void serv_reject_chat(connection.PurpleConnection *, glib.GHashTable *data) + void serv_got_chat_invite(connection.PurpleConnection *gc, \ + const_char *name, const_char *who, const_char *message, \ + glib.GHashTable *data) + conversation.PurpleConversation *serv_got_joined_chat( \ + connection.PurpleConnection *gc, int id, const_char *name) + void purple_serv_got_join_chat_failed(connection.PurpleConnection *gc, \ + glib.GHashTable *data) + void serv_got_chat_left(connection.PurpleConnection *g, int id) + void serv_got_chat_in(connection.PurpleConnection *g, int id, \ + const_char *who, conversation.PurpleMessageFlags flags, \ + const_char *message, time_t mtime) + void serv_send_file(connection.PurpleConnection *gc, const_char *who, \ + const_char *file)