From c437b1ed8795f9db28d24719c856a462d764fdcc Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 28 Apr 2009 16:15:05 +0100 Subject: call-handler: get the contact from the TpCall if it has not been defined during construction --- libempathy/empathy-call-handler.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libempathy/empathy-call-handler.c b/libempathy/empathy-call-handler.c index 6f7ed8b04..bccbeaea2 100644 --- a/libempathy/empathy-call-handler.c +++ b/libempathy/empathy-call-handler.c @@ -30,6 +30,7 @@ #include "empathy-call-handler.h" #include "empathy-dispatcher.h" #include "empathy-marshal.h" +#include "empathy-tp-contact-factory.h" #include "empathy-utils.h" G_DEFINE_TYPE(EmpathyCallHandler, empathy_call_handler, G_TYPE_OBJECT) @@ -113,6 +114,17 @@ empathy_call_handler_init (EmpathyCallHandler *obj) obj->priv = priv; } +static void +empathy_call_handler_constructed (GObject *object) +{ + EmpathyCallHandlerPriv *priv = GET_PRIV (object); + + if (priv->contact == NULL) + { + g_object_get (priv->call, "contact", &(priv->contact), NULL); + } +} + static void empathy_call_handler_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) @@ -160,6 +172,7 @@ empathy_call_handler_class_init (EmpathyCallHandlerClass *klass) g_type_class_add_private (klass, sizeof (EmpathyCallHandlerPriv)); + object_class->constructed = empathy_call_handler_constructed; object_class->set_property = empathy_call_handler_set_property; object_class->get_property = empathy_call_handler_get_property; object_class->dispose = empathy_call_handler_dispose; -- cgit v1.2.3