aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/gossip-chat.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-06-14 05:58:16 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-06-14 05:58:16 +0800
commit4ce14ebec31f60a4a6bdd781f88607731912f557 (patch)
tree0ee31695ccdd06cae5f5b09bf5098707528b1dd3 /libempathy-gtk/gossip-chat.c
parente24e8894479c1b69364faeb315ab0d0dbf7989f1 (diff)
downloadgsoc2013-empathy-4ce14ebec31f60a4a6bdd781f88607731912f557.tar
gsoc2013-empathy-4ce14ebec31f60a4a6bdd781f88607731912f557.tar.gz
gsoc2013-empathy-4ce14ebec31f60a4a6bdd781f88607731912f557.tar.bz2
gsoc2013-empathy-4ce14ebec31f60a4a6bdd781f88607731912f557.tar.lz
gsoc2013-empathy-4ce14ebec31f60a4a6bdd781f88607731912f557.tar.xz
gsoc2013-empathy-4ce14ebec31f60a4a6bdd781f88607731912f557.tar.zst
gsoc2013-empathy-4ce14ebec31f60a4a6bdd781f88607731912f557.zip
New window for viewing logs.
2007-06-13 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/Makefile.am: * libempathy-gtk/gossip-log-window.glade: * libempathy-gtk/gossip-log-window.h: * libempathy-gtk/gossip-log-window.c: * libempathy/empathy-log-manager.c: * libempathy/empathy-log-manager.h: * libempathy-gtk/gossip-chat.c: * libempathy-gtk/empathy-main-window.c: New window for viewing logs. * libempathy-gtk/gossip-chat-view.c: Do not use smooth scroll when resizing the view. * libempathy-gtk/gossip-contact-list-store.c: Do not set active contacts when creating the store, and when contact groups changed. * src/empathy-main.c: Fix warning when using command-line options. * libempathy/empathy-tp-contact-list.c: Check if we have an aliasing iface before setting the alias of a contact. * TODO: Updated. * data/jabber.profile: Ignore ssl errors by default. This is a security vulnerability but we don't really have the choice. * libempathy/gossip-contact.h: * libempathy/gossip-contact.c: Add a "is-user" property to know if it's our self contact. * libempathy/gossip-message.h: * libempathy/gossip-message.c: Add a "receiver" property like that we have our self contact for nick highlight. svn path=/trunk/; revision=148
Diffstat (limited to 'libempathy-gtk/gossip-chat.c')
-rw-r--r--libempathy-gtk/gossip-chat.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/libempathy-gtk/gossip-chat.c b/libempathy-gtk/gossip-chat.c
index 0f6335617..657535d5a 100644
--- a/libempathy-gtk/gossip-chat.c
+++ b/libempathy-gtk/gossip-chat.c
@@ -341,9 +341,8 @@ static void
chat_send (GossipChat *chat,
const gchar *msg)
{
- GossipChatPriv *priv;
- GossipMessage *message;
- GossipContact *own_contact;
+ GossipChatPriv *priv;
+ GossipMessage *message;
priv = GET_PRIV (chat);
@@ -361,9 +360,7 @@ chat_send (GossipChat *chat,
/* FIXME: add here something to let group/privrate chat handle
* some special messages */
- own_contact = empathy_contact_manager_get_user (priv->manager, chat->account);
message = gossip_message_new (msg);
- gossip_message_set_sender (message, own_contact);
empathy_tp_chat_send (priv->tp_chat, message);
@@ -415,6 +412,7 @@ chat_message_received_cb (EmpathyTpChat *tp_chat,
if (timestamp >= priv->time_joined) {
empathy_log_manager_add_message (priv->log_manager,
gossip_chat_get_id (chat),
+ gossip_chat_is_group_chat (chat),
message);
}
@@ -1035,14 +1033,12 @@ chat_state_changed_cb (EmpathyTpChat *tp_chat,
GossipChat *chat)
{
GossipChatPriv *priv;
- GossipContact *own_contact;
GList *l;
gboolean was_composing;
priv = GET_PRIV (chat);
- own_contact = gossip_contact_get_user (contact);
- if (gossip_contact_equal (own_contact, contact)) {
+ if (gossip_contact_is_user (contact)) {
/* We don't care about our own chat state */
return;
}
@@ -1112,7 +1108,8 @@ chat_add_logs (GossipChat *chat)
/* Add messages from last conversation */
messages = empathy_log_manager_get_last_messages (priv->log_manager,
chat->account,
- gossip_chat_get_id (chat));
+ gossip_chat_get_id (chat),
+ gossip_chat_is_group_chat (chat));
num_messages = g_list_length (messages);
for (l = messages, i = 0; l; l = l->next, i++) {
@@ -1498,7 +1495,7 @@ gossip_chat_should_play_sound (GossipChat *chat)
gboolean
gossip_chat_should_highlight_nick (GossipMessage *message)
{
- GossipContact *my_contact;
+ GossipContact *contact;
const gchar *msg, *to;
gchar *cf_msg, *cf_to;
gchar *ch;
@@ -1515,8 +1512,12 @@ gossip_chat_should_highlight_nick (GossipMessage *message)
return FALSE;
}
- my_contact = gossip_contact_get_user (gossip_message_get_sender (message));
- to = gossip_contact_get_name (my_contact);
+ contact = gossip_message_get_receiver (message);
+ if (!contact || !gossip_contact_is_user (contact)) {
+ return FALSE;
+ }
+
+ to = gossip_contact_get_name (contact);
if (!to) {
return FALSE;
}