Initial Buddy class reimplementation.
[python-purple] / conversation.pyx
index 5d5b3c3..04da1b4 100644 (file)
@@ -27,7 +27,7 @@ cdef class Conversation:
     cdef object __name
 
     def __init__(self):
-        conversation.c_purple_conversations_init()
+        conversation.purple_conversations_init()
         self.__name = None
         self.__acc = None
 
@@ -48,29 +48,29 @@ cdef class Conversation:
         self.__acc = acc
         self.__name = name
 
-        c_account = account.c_purple_accounts_find(acc[0], acc[1])
+        c_account = account.purple_accounts_find(<char *> acc[0], <char *> acc[1])
         if not c_account:
             return
 
         if type == "UNKNOWN":
             self.__conv =\
-            conversation.c_purple_conversation_new(conversation.PURPLE_CONV_TYPE_UNKNOWN,\
+            conversation.purple_conversation_new(conversation.PURPLE_CONV_TYPE_UNKNOWN,\
                 c_account, self.__name)
         elif type == "IM":
             self.__conv =\
-            conversation.c_purple_conversation_new(conversation.PURPLE_CONV_TYPE_IM,\
+            conversation.purple_conversation_new(conversation.PURPLE_CONV_TYPE_IM,\
                 <account.PurpleAccount*> c_account, self.__name)
         elif type == "CHAT":
             self.__conv =\
-            conversation.c_purple_conversation_new(conversation.PURPLE_CONV_TYPE_CHAT,\
+            conversation.purple_conversation_new(conversation.PURPLE_CONV_TYPE_CHAT,\
                 c_account, self.__name)
         elif type == "MISC":
             self.__conv =\
-            conversation.c_purple_conversation_new(conversation.PURPLE_CONV_TYPE_MISC,\
+            conversation.purple_conversation_new(conversation.PURPLE_CONV_TYPE_MISC,\
                 c_account, self.__name)
         elif type == "ANY":
             self.__conv =\
-            conversation.c_purple_conversation_new(conversation.PURPLE_CONV_TYPE_ANY,\
+            conversation.purple_conversation_new(conversation.PURPLE_CONV_TYPE_ANY,\
                 c_account, self.__name)
 
     def conversation_set_ui_ops(self):
@@ -91,16 +91,16 @@ cdef class Conversation:
         c_conv_ui_ops.custom_smiley_close = NULL
         c_conv_ui_ops.send_confirm = NULL
 
-        conversation.c_purple_conversation_set_ui_ops(self.__conv, &c_conv_ui_ops)
+        conversation.purple_conversation_set_ui_ops(self.__conv, &c_conv_ui_ops)
 
     def write(self, char *message):
         if self.__conv:
-            conversation.c_purple_conv_im_send(conversation.c_purple_conversation_get_im_data(self.__conv), message)
+            conversation.purple_conv_im_send(conversation.purple_conversation_get_im_data(self.__conv), message)
 
     def get_handle(self):
-        conversation.c_purple_conversations_get_handle()
+        conversation.purple_conversations_get_handle()
 
     def destroy(self):
         print "[DEBUG]: Destroy conversation: %s" % self.__name
         if self.__conv:
-            conversation.c_purple_conversation_destroy(self.__conv)
+            conversation.purple_conversation_destroy(self.__conv)