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/>.
23 ctypedef char const_char "const char"
24 ctypedef glib.guchar const_guchar "const guchar"
25 ctypedef long int time_t
29 cdef void create_conversation (conversation.PurpleConversation *conv):
30 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
31 "create-conversation\n")
32 cdef char *c_name = NULL
34 c_name = <char *> conversation.c_purple_conversation_get_name(conv)
40 type = conversation.c_purple_conversation_get_type(conv)
43 (<object>conversation_cbs["create-conversation"])(name, type)
47 cdef void destroy_conversation (conversation.PurpleConversation *conv):
48 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
49 "destroy-conversation\n")
51 (<object>conversation_cbs["destroy-conversation"])("destroy-conversation: TODO")
55 cdef void write_chat (conversation.PurpleConversation *conv, const_char *who,
56 const_char *message, conversation.PurpleMessageFlags flags,
58 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
61 (<object>conversation_cbs["write-chat"])("write-chat: TODO")
65 cdef void write_im (conversation.PurpleConversation *conv, const_char *who,
66 const_char *c_message, conversation.PurpleMessageFlags flags,
68 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation", "write-im\n")
69 cdef account.PurpleAccount *acc = conversation.c_purple_conversation_get_account(conv)
70 cdef blist.PurpleBuddy *buddy = NULL
71 cdef char *c_username = NULL
72 cdef char *c_sender_alias = NULL
74 c_username = <char *> account.c_purple_account_get_username(acc)
82 buddy = blist.c_purple_find_buddy(acc, <char *> who)
83 c_sender_alias = <char *> blist.c_purple_buddy_get_alias_only(buddy)
88 sender_alias = c_sender_alias
93 message = <char *> c_message
98 (<object>conversation_cbs["write-im"])(username, sender, \
99 sender_alias, message)
103 cdef void write_conv (conversation.PurpleConversation *conv, const_char *name,
104 const_char *alias, const_char *message,
105 conversation.PurpleMessageFlags flags, time_t mtime):
106 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
109 (<object>conversation_cbs["write-conv"])("write-conv: TODO")
113 cdef void chat_add_users (conversation.PurpleConversation *conv,
114 glib.GList *cbuddies, glib.gboolean new_arrivals):
115 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
118 (<object>conversation_cbs["chat-add-users"])("chat-add-users: TODO")
122 cdef void chat_rename_user (conversation.PurpleConversation *conv,
123 const_char *old_name, const_char *new_name,
124 const_char *new_alias):
125 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
126 "chat-rename-user\n")
128 (<object>conversation_cbs["chat-rename-user"])("chat-rename-user: TODO")
132 cdef void chat_remove_users (conversation.PurpleConversation *conv,
134 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
135 "chat-remove-users\n")
137 (<object>conversation_cbs["chat-remove-users"])("chat-remove-users: TODO")
141 cdef void chat_update_user (conversation.PurpleConversation *conv,
143 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
144 "chat-update-user\n")
146 (<object>conversation_cbs["chat-update-user"])("chat-update-user: TODO")
150 cdef void present (conversation.PurpleConversation *conv):
151 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
154 (<object>conversation_cbs["present"])("present: TODO")
158 cdef glib.gboolean has_focus (conversation.PurpleConversation *conv):
159 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
162 (<object>conversation_cbs["has-focus"])("has-focus: TODO")
167 cdef glib.gboolean custom_smiley_add (conversation.PurpleConversation *conv,
168 const_char *smile, glib.gboolean remote):
169 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
170 "custom-smiley-add\n")
172 (<object>conversation_cbs["custom-smiley-add"])("custom-smiley-add: TODO")
177 cdef void custom_smiley_write (conversation.PurpleConversation *conv,
178 const_char *smile, const_guchar *data,
180 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
181 "custom-smiley-write\n")
183 (<object>conversation_cbs["custom-smiley-write"])("custom-smiley-write: TODO")
188 cdef void custom_smiley_close (conversation.PurpleConversation *conv,
190 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
191 "custom-smiley-close\n")
193 (<object>conversation_cbs["custom-smiley-close"])("custom-smiley-close: TODO")
197 cdef void send_confirm (conversation.PurpleConversation *conv,
198 const_char *message):
199 debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "conversation",
202 (<object>conversation_cbs["send-confirm"])("send-confirm: TODO")