projects
/
python-purple
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implemented status_changed callback.
[python-purple]
/
conversation_cbs.pxd
diff --git
a/conversation_cbs.pxd
b/conversation_cbs.pxd
index
731eaa1
..
f3a6bd7
100644
(file)
--- a/
conversation_cbs.pxd
+++ b/
conversation_cbs.pxd
@@
-31,16
+31,16
@@
cdef void create_conversation(conversation.PurpleConversation *conv):
Called when a conv is created (but before the conversation-created
signal is emitted).
"""
Called when a conv is created (but before the conversation-created
signal is emitted).
"""
- debug.c_purple_debug_info("conversation", "%s", "create-conversation\n")
+ debug.purple_debug_info("conversation", "%s", "create-conversation\n")
cdef char *c_name = NULL
cdef char *c_name = NULL
- c_name = <char *> conversation.c_purple_conversation_get_name(conv)
+ c_name = <char *> conversation.purple_conversation_get_name(conv)
if c_name == NULL:
name = None
else:
name = c_name
if c_name == NULL:
name = None
else:
name = c_name
- type = conversation.c_purple_conversation_get_type(conv)
+ type = conversation.purple_conversation_get_type(conv)
if conversation_cbs.has_key("create-conversation"):
(<object> conversation_cbs["create-conversation"])(name, type)
if conversation_cbs.has_key("create-conversation"):
(<object> conversation_cbs["create-conversation"])(name, type)
@@
-49,7
+49,7
@@
cdef void destroy_conversation(conversation.PurpleConversation *conv):
"""
Called just before a conv is freed.
"""
"""
Called just before a conv is freed.
"""
- debug.c_purple_debug_info("conversation", "%s", "destroy-conversation\n")
+ debug.purple_debug_info("conversation", "%s", "destroy-conversation\n")
if conversation_cbs.has_key("destroy-conversation"):
(<object> conversation_cbs["destroy-conversation"])("destroy-conversation: TODO")
if conversation_cbs.has_key("destroy-conversation"):
(<object> conversation_cbs["destroy-conversation"])("destroy-conversation: TODO")
@@
-61,7
+61,7
@@
cdef void write_chat(conversation.PurpleConversation *conv, const_char *who, \
back to using write_conv.
@see purple_conv_chat_write()
"""
back to using write_conv.
@see purple_conv_chat_write()
"""
- debug.c_purple_debug_info("conversation", "%s", "write-chat\n")
+ debug.purple_debug_info("conversation", "%s", "write-chat\n")
if conversation_cbs.has_key("write-chat"):
(<object> conversation_cbs["write-chat"])("write-chat: TODO")
if conversation_cbs.has_key("write-chat"):
(<object> conversation_cbs["write-chat"])("write-chat: TODO")
@@
-73,8
+73,8
@@
cdef void write_im(conversation.PurpleConversation *conv, const_char *who, \
will fall back to using write_conv.
@see purple_conv_im_write()
"""
will fall back to using write_conv.
@see purple_conv_im_write()
"""
- debug.c_purple_debug_info("conversation", "%s", "write-im\n")
- cdef account.PurpleAccount *acc = conversation.c_purple_conversation_get_account(conv)
+ debug.purple_debug_info("conversation", "%s", "write-im\n")
+ cdef account.PurpleAccount *acc = conversation.purple_conversation_get_account(conv)
cdef blist.PurpleBuddy *buddy = NULL
cdef char *c_username = NULL
cdef char *c_sender_alias = NULL
cdef blist.PurpleBuddy *buddy = NULL
cdef char *c_username = NULL
cdef char *c_sender_alias = NULL
@@
-85,15
+85,16
@@
cdef void write_im(conversation.PurpleConversation *conv, const_char *who, \
else:
username = None
else:
username = None
- if who:
- sender = <char *> who
- buddy = blist.c_purple_find_buddy(acc, <char *> who)
- c_sender_alias = <char *> blist.c_purple_buddy_get_alias_only(buddy)
- else:
- sender = None
+ if who == NULL:
+ who = conversation.purple_conversation_get_name(conv)
+
+ sender = <char *> who
+ buddy = blist.purple_find_buddy(acc, <char *> who)
+ if buddy:
+ c_sender_alias = <char *> blist.purple_buddy_get_alias_only(buddy)
if c_sender_alias:
if c_sender_alias:
- sender_alias = c_sender_alias
+ sender_alias = unicode(c_sender_alias, 'utf-8')
else:
sender_alias = None
else:
sender_alias = None
@@
-102,9
+103,15
@@
cdef void write_im(conversation.PurpleConversation *conv, const_char *who, \
else:
message = None
else:
message = None
+ # FIXME: Maybe we need add more purple flags in the future
+ if flags & conversation.PURPLE_MESSAGE_SEND:
+ flag = "SEND"
+ else:
+ flag = "RECV"
+
if conversation_cbs.has_key("write-im"):
(<object> conversation_cbs["write-im"])(username, sender, \
if conversation_cbs.has_key("write-im"):
(<object> conversation_cbs["write-im"])(username, sender, \
- sender_alias, message)
+ sender_alias, message, flag)
cdef void write_conv(conversation.PurpleConversation *conv, const_char *name, \
const_char *alias, const_char *message, \
cdef void write_conv(conversation.PurpleConversation *conv, const_char *name, \
const_char *alias, const_char *message, \
@@
-117,7
+124,7
@@
cdef void write_conv(conversation.PurpleConversation *conv, const_char *name, \
and your users will hate you.
@see purple_conversation_write()
"""
and your users will hate you.
@see purple_conversation_write()
"""
- debug.c_purple_debug_info("conversation", "%s", "write-conv\n")
+ debug.purple_debug_info("conversation", "%s", "write-conv\n")
if conversation_cbs.has_key("write-conv"):
(<object> conversation_cbs["write-conv"])("write-conv: TODO")
if conversation_cbs.has_key("write-conv"):
(<object> conversation_cbs["write-conv"])("write-conv: TODO")
@@
-131,7
+138,7
@@
cdef void chat_add_users(conversation.PurpleConversation *conv, \
conversation by purple_conv_chat_add_users().)
@see purple_conv_chat_add_users()
"""
conversation by purple_conv_chat_add_users().)
@see purple_conv_chat_add_users()
"""
- debug.c_purple_debug_info("conversation", "%s", "chat-add-users\n")
+ debug.purple_debug_info("conversation", "%s", "chat-add-users\n")
if conversation_cbs.has_key("chat-add-users"):
(<object> conversation_cbs["chat-add-users"])("chat-add-users: TODO")
if conversation_cbs.has_key("chat-add-users"):
(<object> conversation_cbs["chat-add-users"])("chat-add-users: TODO")
@@
-144,7
+151,7
@@
cdef void chat_rename_user(conversation.PurpleConversation *conv, \
@param new_alias new_name's new_alias, if they have one.
@see purple_conv_chat_rename_user()
"""
@param new_alias new_name's new_alias, if they have one.
@see purple_conv_chat_rename_user()
"""
- debug.c_purple_debug_info("conversation", "%s", "chat-rename-user\n")
+ debug.purple_debug_info("conversation", "%s", "chat-rename-user\n")
if conversation_cbs.has_key("chat-rename-user"):
(<object> conversation_cbs["chat-rename-user"])("chat-rename-user: TODO")
if conversation_cbs.has_key("chat-rename-user"):
(<object> conversation_cbs["chat-rename-user"])("chat-rename-user: TODO")
@@
-154,7
+161,7
@@
cdef void chat_remove_users(conversation.PurpleConversation *conv, \
Remove users from a chat.
@param users A GList of const char *s.
"""
Remove users from a chat.
@param users A GList of const char *s.
"""
- debug.c_purple_debug_info("conversation", "%s", "chat-remove-users\n")
+ debug.purple_debug_info("conversation", "%s", "chat-remove-users\n")
if conversation_cbs.has_key("chat-remove-users"):
(<object> conversation_cbs["chat-remove-users"])("chat-remove-users: TODO")
if conversation_cbs.has_key("chat-remove-users"):
(<object> conversation_cbs["chat-remove-users"])("chat-remove-users: TODO")
@@
-164,7
+171,7
@@
cdef void chat_update_user(conversation.PurpleConversation *conv, \
Called when a user's flags are changed.
@see purple_conv_chat_user_set_flags()
"""
Called when a user's flags are changed.
@see purple_conv_chat_user_set_flags()
"""
- debug.c_purple_debug_info("conversation", "%s", "chat-update-user\n")
+ debug.purple_debug_info("conversation", "%s", "chat-update-user\n")
if conversation_cbs.has_key("chat-update-user"):
(<object> conversation_cbs["chat-update-user"])("chat-update-user: TODO")
if conversation_cbs.has_key("chat-update-user"):
(<object> conversation_cbs["chat-update-user"])("chat-update-user: TODO")
@@
-173,7
+180,7
@@
cdef void present(conversation.PurpleConversation *conv):
Present this conversation to the user; for example, by displaying the IM
dialog.
"""
Present this conversation to the user; for example, by displaying the IM
dialog.
"""
- debug.c_purple_debug_info("conversation", "%s", "present\n")
+ debug.purple_debug_info("conversation", "%s", "present\n")
if conversation_cbs.has_key("present"):
(<object> conversation_cbs["present"])("present: TODO")
if conversation_cbs.has_key("present"):
(<object> conversation_cbs["present"])("present: TODO")
@@
-182,7
+189,7
@@
cdef glib.gboolean has_focus(conversation.PurpleConversation *conv):
If this UI has a concept of focus (as in a windowing system) and this
conversation has the focus, return TRUE; otherwise, return FALSE.
"""
If this UI has a concept of focus (as in a windowing system) and this
conversation has the focus, return TRUE; otherwise, return FALSE.
"""
- debug.c_purple_debug_info("conversation", "%s", "has-focus\n")
+ debug.purple_debug_info("conversation", "%s", "has-focus\n")
if conversation_cbs.has_key("has-focus"):
(<object> conversation_cbs["has-focus"])("has-focus: TODO")
return False
if conversation_cbs.has_key("has-focus"):
(<object> conversation_cbs["has-focus"])("has-focus: TODO")
return False
@@
-192,7
+199,7
@@
cdef glib.gboolean custom_smiley_add(conversation.PurpleConversation *conv, \
"""
Custom smileys (add).
"""
"""
Custom smileys (add).
"""
- debug.c_purple_debug_info("conversation", "%s", "custom-smiley-add\n")
+ debug.purple_debug_info("conversation", "%s", "custom-smiley-add\n")
if conversation_cbs.has_key("custom-smiley-add"):
(<object> conversation_cbs["custom-smiley-add"])("custom-smiley-add: TODO")
return False
if conversation_cbs.has_key("custom-smiley-add"):
(<object> conversation_cbs["custom-smiley-add"])("custom-smiley-add: TODO")
return False
@@
-202,7
+209,7
@@
cdef void custom_smiley_write(conversation.PurpleConversation *conv, \
"""
Custom smileys (write).
"""
"""
Custom smileys (write).
"""
- debug.c_purple_debug_info("conversation", "%s", "custom-smiley-write\n")
+ debug.purple_debug_info("conversation", "%s", "custom-smiley-write\n")
if conversation_cbs.has_key("custom-smiley-write"):
(<object> conversation_cbs["custom-smiley-write"])("custom-smiley-write: TODO")
if conversation_cbs.has_key("custom-smiley-write"):
(<object> conversation_cbs["custom-smiley-write"])("custom-smiley-write: TODO")
@@
-211,7
+218,7
@@
cdef void custom_smiley_close(conversation.PurpleConversation *conv, \
"""
Custom smileys (close).
"""
"""
Custom smileys (close).
"""
- debug.c_purple_debug_info("conversation", "%s", "custom-smiley-close\n")
+ debug.purple_debug_info("conversation", "%s", "custom-smiley-close\n")
if conversation_cbs.has_key("custom-smiley-close"):
(<object> conversation_cbs["custom-smiley-close"])("custom-smiley-close: TODO")
if conversation_cbs.has_key("custom-smiley-close"):
(<object> conversation_cbs["custom-smiley-close"])("custom-smiley-close: TODO")
@@
-222,6
+229,6
@@
cdef void send_confirm(conversation.PurpleConversation *conv, \
arrange for the message to be sent if the user accepts. If this field
is NULL, libpurple will fall back to using purple_request_action().
"""
arrange for the message to be sent if the user accepts. If this field
is NULL, libpurple will fall back to using purple_request_action().
"""
- debug.c_purple_debug_info("conversation", "%s", "send-confirm\n")
+ debug.purple_debug_info("conversation", "%s", "send-confirm\n")
if conversation_cbs.has_key("send-confirm"):
(<object> conversation_cbs["send-confirm"])("send-confirm: TODO")
if conversation_cbs.has_key("send-confirm"):
(<object> conversation_cbs["send-confirm"])("send-confirm: TODO")