aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-chat.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-04-20 02:36:19 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-04-20 02:36:19 +0800
commit6bb385c3ada233409a10088f2de1a134d0707fda (patch)
tree9f8e892ba13bd58f91fb4be9c20a041f06a61216 /libempathy/empathy-tp-chat.c
parentee5a0b876a796f762195addeb43ef41e6bdd4013 (diff)
downloadgsoc2013-empathy-6bb385c3ada233409a10088f2de1a134d0707fda.tar
gsoc2013-empathy-6bb385c3ada233409a10088f2de1a134d0707fda.tar.gz
gsoc2013-empathy-6bb385c3ada233409a10088f2de1a134d0707fda.tar.bz2
gsoc2013-empathy-6bb385c3ada233409a10088f2de1a134d0707fda.tar.lz
gsoc2013-empathy-6bb385c3ada233409a10088f2de1a134d0707fda.tar.xz
gsoc2013-empathy-6bb385c3ada233409a10088f2de1a134d0707fda.tar.zst
gsoc2013-empathy-6bb385c3ada233409a10088f2de1a134d0707fda.zip
Fix acknoledge of messages
svn path=/trunk/; revision=966
Diffstat (limited to 'libempathy/empathy-tp-chat.c')
-rw-r--r--libempathy/empathy-tp-chat.c121
1 files changed, 74 insertions, 47 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 430014759..34fcf64dc 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -796,7 +796,7 @@ tp_chat_channel_ready_cb (EmpathyTpChat *chat)
}
tp_cli_channel_type_text_call_list_pending_messages (priv->channel, -1,
- priv->acknowledge,
+ FALSE,
tp_chat_list_pending_messages_cb,
NULL, NULL,
G_OBJECT (chat));
@@ -1075,48 +1075,6 @@ empathy_tp_chat_new (TpChannel *channel,
NULL);
}
-void
-empathy_tp_chat_send (EmpathyTpChat *chat,
- EmpathyMessage *message)
-{
- EmpathyTpChatPriv *priv = GET_PRIV (chat);
- const gchar *message_body;
- EmpathyMessageType 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);
-
- empathy_debug (DEBUG_DOMAIN, "Sending message: %s", message_body);
- tp_cli_channel_type_text_call_send (priv->channel, -1,
- message_type,
- message_body,
- tp_chat_async_cb,
- "sending message", NULL,
- G_OBJECT (chat));
-}
-
-void
-empathy_tp_chat_set_state (EmpathyTpChat *chat,
- TpChannelChatState state)
-{
- EmpathyTpChatPriv *priv = GET_PRIV (chat);
-
- g_return_if_fail (EMPATHY_IS_TP_CHAT (chat));
- g_return_if_fail (priv->ready);
-
- empathy_debug (DEBUG_DOMAIN, "Set state: %d", state);
- tp_cli_channel_interface_chat_state_call_set_chat_state (priv->channel, -1,
- state,
- tp_chat_async_cb,
- "setting chat state",
- NULL,
- G_OBJECT (chat));
-}
-
const gchar *
empathy_tp_chat_get_id (EmpathyTpChat *chat)
{
@@ -1138,6 +1096,16 @@ empathy_tp_chat_get_remote_contact (EmpathyTpChat *chat)
return priv->remote_contact;
}
+McAccount *
+empathy_tp_chat_get_account (EmpathyTpChat *chat)
+{
+ EmpathyTpChatPriv *priv = GET_PRIV (chat);
+
+ g_return_val_if_fail (EMPATHY_IS_TP_CHAT (chat), FALSE);
+
+ return priv->account;
+}
+
gboolean
empathy_tp_chat_is_ready (EmpathyTpChat *chat)
{
@@ -1158,13 +1126,72 @@ empathy_tp_chat_get_members_count (EmpathyTpChat *chat)
return priv->members_count;
}
-McAccount *
-empathy_tp_chat_get_account (EmpathyTpChat *chat)
+void
+empathy_tp_chat_set_acknowledge (EmpathyTpChat *chat,
+ gboolean acknowledge)
{
EmpathyTpChatPriv *priv = GET_PRIV (chat);
- g_return_val_if_fail (EMPATHY_IS_TP_CHAT (chat), FALSE);
+ g_return_if_fail (EMPATHY_IS_TP_CHAT (chat));
- return priv->account;
+ priv->acknowledge = acknowledge;
+ g_object_notify (G_OBJECT (chat), "acknowledge");
+}
+
+void
+empathy_tp_chat_emit_pendings (EmpathyTpChat *chat)
+{
+ EmpathyTpChatPriv *priv = GET_PRIV (chat);
+
+ g_return_if_fail (EMPATHY_IS_TP_CHAT (chat));
+ g_return_if_fail (priv->ready);
+
+ tp_cli_channel_type_text_call_list_pending_messages (priv->channel, -1,
+ FALSE,
+ tp_chat_list_pending_messages_cb,
+ NULL, NULL,
+ G_OBJECT (chat));
+}
+
+void
+empathy_tp_chat_send (EmpathyTpChat *chat,
+ EmpathyMessage *message)
+{
+ EmpathyTpChatPriv *priv = GET_PRIV (chat);
+ const gchar *message_body;
+ EmpathyMessageType 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);
+
+ empathy_debug (DEBUG_DOMAIN, "Sending message: %s", message_body);
+ tp_cli_channel_type_text_call_send (priv->channel, -1,
+ message_type,
+ message_body,
+ tp_chat_async_cb,
+ "sending message", NULL,
+ G_OBJECT (chat));
+}
+
+void
+empathy_tp_chat_set_state (EmpathyTpChat *chat,
+ TpChannelChatState state)
+{
+ EmpathyTpChatPriv *priv = GET_PRIV (chat);
+
+ g_return_if_fail (EMPATHY_IS_TP_CHAT (chat));
+ g_return_if_fail (priv->ready);
+
+ empathy_debug (DEBUG_DOMAIN, "Set state: %d", state);
+ tp_cli_channel_interface_chat_state_call_set_chat_state (priv->channel, -1,
+ state,
+ tp_chat_async_cb,
+ "setting chat state",
+ NULL,
+ G_OBJECT (chat));
}