aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/gossip-contact.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-contact.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-contact.c')
-rw-r--r--libempathy/gossip-contact.c79
1 files changed, 48 insertions, 31 deletions
diff --git a/libempathy/gossip-contact.c b/libempathy/gossip-contact.c
index 82147f67e..53fe7e182 100644
--- a/libempathy/gossip-contact.c
+++ b/libempathy/gossip-contact.c
@@ -30,7 +30,6 @@
#include "gossip-contact.h"
#include "gossip-utils.h"
#include "gossip-debug.h"
-#include "empathy-contact-manager.h"
#define DEBUG_DOMAIN "Contact"
@@ -47,6 +46,7 @@ struct _GossipContactPriv {
GList *groups;
GossipSubscription subscription;
guint handle;
+ gboolean is_user;
};
static void contact_class_init (GossipContactClass *class);
@@ -70,7 +70,8 @@ enum {
PROP_PRESENCE,
PROP_GROUPS,
PROP_SUBSCRIPTION,
- PROP_HANDLE
+ PROP_HANDLE,
+ PROP_IS_USER
};
static gpointer parent_class = NULL;
@@ -180,6 +181,13 @@ contact_class_init (GossipContactClass *class)
G_MAXUINT,
0,
G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_IS_USER,
+ g_param_spec_boolean ("is-user",
+ "Contact is-user",
+ "Is contact the user",
+ FALSE,
+ G_PARAM_READWRITE));
g_type_class_add_private (object_class, sizeof (GossipContactPriv));
}
@@ -187,17 +195,6 @@ contact_class_init (GossipContactClass *class)
static void
contact_init (GossipContact *contact)
{
- GossipContactPriv *priv;
-
- priv = GET_PRIV (contact);
-
- priv->id = NULL;
- priv->name = NULL;
- priv->avatar = NULL;
- priv->account = NULL;
- priv->presence = NULL;
- priv->groups = NULL;
- priv->handle = 0;
}
static void
@@ -269,6 +266,9 @@ contact_get_property (GObject *object,
case PROP_HANDLE:
g_value_set_uint (value, priv->handle);
break;
+ case PROP_IS_USER:
+ g_value_set_boolean (value, priv->is_user);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
@@ -318,6 +318,10 @@ contact_set_property (GObject *object,
gossip_contact_set_handle (GOSSIP_CONTACT (object),
g_value_get_uint (value));
break;
+ case PROP_IS_USER:
+ gossip_contact_set_is_user (GOSSIP_CONTACT (object),
+ g_value_get_boolean (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
@@ -449,6 +453,18 @@ gossip_contact_get_handle (GossipContact *contact)
return priv->handle;
}
+gboolean
+gossip_contact_is_user (GossipContact *contact)
+{
+ GossipContactPriv *priv;
+
+ g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), FALSE);
+
+ priv = GET_PRIV (contact);
+
+ return priv->is_user;
+}
+
void
gossip_contact_set_id (GossipContact *contact,
const gchar *id)
@@ -630,6 +646,25 @@ gossip_contact_set_handle (GossipContact *contact,
}
void
+gossip_contact_set_is_user (GossipContact *contact,
+ gboolean is_user)
+{
+ GossipContactPriv *priv;
+
+ g_return_if_fail (GOSSIP_IS_CONTACT (contact));
+
+ priv = GET_PRIV (contact);
+
+ if (priv->is_user == is_user) {
+ return;
+ }
+
+ priv->is_user = is_user;
+
+ g_object_notify (G_OBJECT (contact), "is-user");
+}
+
+void
gossip_contact_add_group (GossipContact *contact,
const gchar *group)
{
@@ -722,24 +757,6 @@ gossip_contact_get_status (GossipContact *contact)
return gossip_presence_state_get_default_status (MC_PRESENCE_OFFLINE);
}
-GossipContact *
-gossip_contact_get_user (GossipContact *contact)
-{
- GossipContactPriv *priv;
- EmpathyContactManager *manager;
- GossipContact *user_contact;
-
- g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), NULL);
-
- priv = GET_PRIV (contact);
-
- manager = empathy_contact_manager_new ();
- user_contact = empathy_contact_manager_get_user (manager, priv->account);
- g_object_unref (manager);
-
- return user_contact;
-}
-
gboolean
gossip_contact_equal (gconstpointer v1,
gconstpointer v2)