aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/gossip-message.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/gossip-message.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/gossip-message.c')
-rw-r--r--libempathy/gossip-message.c56
1 files changed, 52 insertions, 4 deletions
diff --git a/libempathy/gossip-message.c b/libempathy/gossip-message.c
index c4844e655..a46a2a5dc 100644
--- a/libempathy/gossip-message.c
+++ b/libempathy/gossip-message.c
@@ -33,6 +33,7 @@ typedef struct _GossipMessagePriv GossipMessagePriv;
struct _GossipMessagePriv {
GossipMessageType type;
GossipContact *sender;
+ GossipContact *receiver;
gchar *body;
GossipTime timestamp;
@@ -54,6 +55,7 @@ enum {
PROP_0,
PROP_TYPE,
PROP_SENDER,
+ PROP_RECEIVER,
PROP_BODY,
PROP_TIMESTAMP,
};
@@ -114,7 +116,13 @@ gossip_message_class_init (GossipMessageClass *class)
"The sender of the message",
GOSSIP_TYPE_CONTACT,
G_PARAM_READWRITE));
-
+ g_object_class_install_property (object_class,
+ PROP_RECEIVER,
+ g_param_spec_object ("receiver",
+ "Message Receiver",
+ "The receiver of the message",
+ GOSSIP_TYPE_CONTACT,
+ G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_BODY,
g_param_spec_string ("body",
@@ -144,9 +152,6 @@ gossip_message_init (GossipMessage *message)
priv = GET_PRIV (message);
- priv->type = GOSSIP_MESSAGE_TYPE_NORMAL;
- priv->sender = NULL;
- priv->body = NULL;
priv->timestamp = gossip_time_get_current ();
}
@@ -160,6 +165,9 @@ gossip_message_finalize (GObject *object)
if (priv->sender) {
g_object_unref (priv->sender);
}
+ if (priv->receiver) {
+ g_object_unref (priv->receiver);
+ }
g_free (priv->body);
@@ -183,6 +191,9 @@ message_get_property (GObject *object,
case PROP_SENDER:
g_value_set_object (value, priv->sender);
break;
+ case PROP_RECEIVER:
+ g_value_set_object (value, priv->receiver);
+ break;
case PROP_BODY:
g_value_set_string (value, priv->body);
break;
@@ -211,6 +222,10 @@ message_set_property (GObject *object,
gossip_message_set_sender (GOSSIP_MESSAGE (object),
GOSSIP_CONTACT (g_value_get_object (value)));
break;
+ case PROP_RECEIVER:
+ gossip_message_set_receiver (GOSSIP_MESSAGE (object),
+ GOSSIP_CONTACT (g_value_get_object (value)));
+ break;
case PROP_BODY:
gossip_message_set_body (GOSSIP_MESSAGE (object),
g_value_get_string (value));
@@ -290,6 +305,39 @@ gossip_message_set_sender (GossipMessage *message, GossipContact *contact)
g_object_notify (G_OBJECT (message), "sender");
}
+GossipContact *
+gossip_message_get_receiver (GossipMessage *message)
+{
+ GossipMessagePriv *priv;
+
+ g_return_val_if_fail (GOSSIP_IS_MESSAGE (message), NULL);
+
+ priv = GET_PRIV (message);
+
+ return priv->receiver;
+}
+
+void
+gossip_message_set_receiver (GossipMessage *message, GossipContact *contact)
+{
+ GossipMessagePriv *priv;
+ GossipContact *old_receiver;
+
+ g_return_if_fail (GOSSIP_IS_MESSAGE (message));
+ g_return_if_fail (GOSSIP_IS_CONTACT (contact));
+
+ priv = GET_PRIV (message);
+
+ old_receiver = priv->receiver;
+ priv->receiver = g_object_ref (contact);
+
+ if (old_receiver) {
+ g_object_unref (old_receiver);
+ }
+
+ g_object_notify (G_OBJECT (message), "receiver");
+}
+
const gchar *
gossip_message_get_body (GossipMessage *message)
{