struct _EmpathyTpFilePriv {
EmpathyContactFactory *factory;
- McAccount *account;
gchar *id;
MissionControl *mc;
TpChannel *channel;
enum {
PROP_0,
- PROP_ACCOUNT,
PROP_CHANNEL,
PROP_STATE,
PROP_INCOMING,
{
g_object_unref (tp_file->priv->factory);
}
- if (tp_file->priv->account)
- {
- g_object_unref (tp_file->priv->account);
- }
if (tp_file->priv->mc)
{
g_object_unref (tp_file->priv->mc);
EmpathyTpFile *tp_file;
TpHandle handle;
GHashTable *properties;
+ McAccount *account;
file_obj = G_OBJECT_CLASS (empathy_tp_file_parent_class)->constructor (type,
n_props, props);
tp_file,
NULL, NULL, NULL);
+ account = empathy_channel_get_account (tp_file->priv->channel);
+
handle = tp_channel_get_handle (tp_file->priv->channel, NULL);
tp_file->priv->contact = empathy_contact_factory_get_from_handle (
- tp_file->priv->factory, tp_file->priv->account, (guint) handle);
+ tp_file->priv->factory, account, (guint) handle);
tp_cli_dbus_properties_run_get_all (tp_file->priv->channel,
-1, EMP_IFACE_CHANNEL_TYPE_FILE, &properties, NULL, NULL);
tp_file->priv->incoming = TRUE;
g_hash_table_destroy (properties);
+ g_object_unref (account);
return file_obj;
}
switch (param_id)
{
- case PROP_ACCOUNT:
- g_value_set_object (value, tp_file->priv->account);
- break;
case PROP_CHANNEL:
g_value_set_object (value, tp_file->priv->channel);
break;
EmpathyTpFile *tp_file = (EmpathyTpFile *) object;
switch (param_id)
{
- case PROP_ACCOUNT:
- tp_file->priv->account = g_object_ref (g_value_get_object (value));
- break;
case PROP_CHANNEL:
tp_file->priv->channel = g_object_ref (g_value_get_object (value));
break;
/**
* empathy_tp_file_new:
- * @account: the #McAccount for the channel
* @channel: a Telepathy channel
*
* Creates a new #EmpathyTpFile wrapping @channel.
* Returns: a new #EmpathyTpFile
*/
EmpathyTpFile *
-empathy_tp_file_new (McAccount *account,
- TpChannel *channel)
+empathy_tp_file_new (TpChannel *channel)
{
- g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL);
return g_object_new (EMPATHY_TYPE_TP_FILE,
- "account", account,
"channel", channel,
NULL);
}
object_class->set_property = tp_file_set_property;
/* Construct-only properties */
- g_object_class_install_property (object_class,
- PROP_ACCOUNT,
- g_param_spec_object ("account",
- "channel Account",
- "The account associated with the channel",
- MC_TYPE_ACCOUNT,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
-
g_object_class_install_property (object_class,
PROP_CHANNEL,
g_param_spec_object ("channel",