aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-chat.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-05-06 04:34:41 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-05-06 04:34:41 +0800
commit1557095113a3c0f5baadcfb1e953d73762e5263e (patch)
tree6af706fb1f4f673120981e033768a09169544c11 /libempathy/empathy-tp-chat.c
parent62828fac680bd53e0047d9ae2a281c864075c809 (diff)
downloadgsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar
gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.gz
gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.bz2
gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.lz
gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.xz
gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.zst
gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.zip
Keep a priv pointer in the object struct instead of using G_TYPE_INSTANCE_GET_PRIVATE all the time.
svn path=/trunk/; revision=1082
Diffstat (limited to 'libempathy/empathy-tp-chat.c')
-rw-r--r--libempathy/empathy-tp-chat.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 61859c96e..d4eedf492 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -37,10 +37,8 @@
#define DEBUG_FLAG EMPATHY_DEBUG_TP | EMPATHY_DEBUG_CHAT
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_TP_CHAT, EmpathyTpChatPriv))
-
-struct _EmpathyTpChatPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTpChat)
+typedef struct {
EmpathyContactFactory *factory;
EmpathyContact *user;
EmpathyContact *remote_contact;
@@ -55,7 +53,7 @@ struct _EmpathyTpChatPriv {
GPtrArray *properties;
gboolean ready;
guint members_count;
-};
+} EmpathyTpChatPriv;
typedef struct {
gchar *name;
@@ -64,8 +62,6 @@ typedef struct {
GValue *value;
} TpChatProperty;
-static void empathy_tp_chat_class_init (EmpathyTpChatClass *klass);
-static void empathy_tp_chat_init (EmpathyTpChat *chat);
static void tp_chat_iface_init (EmpathyContactListIface *iface);
enum {
@@ -274,7 +270,7 @@ tp_chat_build_message (EmpathyTpChat *chat,
}
message = empathy_message_new (message_body);
- empathy_message_set_type (message, type);
+ empathy_message_set_tptype (message, type);
empathy_message_set_sender (message, sender);
empathy_message_set_receiver (message, priv->user);
empathy_message_set_timestamp (message, timestamp);
@@ -1060,6 +1056,10 @@ empathy_tp_chat_class_init (EmpathyTpChatClass *klass)
static void
empathy_tp_chat_init (EmpathyTpChat *chat)
{
+ EmpathyTpChatPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chat,
+ EMPATHY_TYPE_TP_CHAT, EmpathyTpChatPriv);
+
+ chat->priv = priv;
}
static void
@@ -1172,16 +1172,16 @@ void
empathy_tp_chat_send (EmpathyTpChat *chat,
EmpathyMessage *message)
{
- EmpathyTpChatPriv *priv = GET_PRIV (chat);
- const gchar *message_body;
- EmpathyMessageType message_type;
+ EmpathyTpChatPriv *priv = GET_PRIV (chat);
+ const gchar *message_body;
+ TpChannelTextMessageType message_type;
g_return_if_fail (EMPATHY_IS_TP_CHAT (chat));
g_return_if_fail (EMPATHY_IS_MESSAGE (message));
g_return_if_fail (priv->ready);
message_body = empathy_message_get_body (message);
- message_type = empathy_message_get_type (message);
+ message_type = empathy_message_get_tptype (message);
DEBUG ("Sending message: %s", message_body);
tp_cli_channel_type_text_call_send (priv->channel, -1,