/* The callback is NOT given a reference to the EmpathyContact objects */ void empathy_tp_contact_factory_get_from_id (EmpathyTpContactFactory *tp_factory, const gchar *id, EmpathyTpContactFactoryContactCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { EmpathyTpContactFactoryPriv *priv = GET_PRIV (tp_factory); GetContactsData *data; g_return_if_fail (EMPATHY_IS_TP_CONTACT_FACTORY (tp_factory)); g_return_if_fail (id != NULL); data = g_slice_new (GetContactsData); data->callback.contact_cb = callback; data->user_data = user_data; data->destroy = destroy; data->tp_factory = g_object_ref (tp_factory); tp_connection_get_contacts_by_id (priv->connection, 1, &id, G_N_ELEMENTS (contact_features), contact_features, get_contact_by_id_cb, data, (GDestroyNotify) get_contacts_data_free, weak_object); }
/* The callback is NOT given a reference to the EmpathyContact objects */ void empathy_tp_contact_factory_get_from_id (TpConnection *connection, const gchar *id, EmpathyTpContactFactoryContactCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { GetContactsData *data; g_return_if_fail (TP_IS_CONNECTION (connection)); g_return_if_fail (id != NULL); data = g_slice_new (GetContactsData); data->callback.contact_cb = callback; data->user_data = user_data; data->destroy = destroy; data->connection = g_object_ref (connection); tp_connection_get_contacts_by_id (connection, 1, &id, G_N_ELEMENTS (contact_features), contact_features, get_contact_by_id_cb, data, (GDestroyNotify) get_contacts_data_free, weak_object); }
static void contact_blocking_dialog_add_contact (GtkWidget *widget, EmpathyContactBlockingDialog *self) { TpConnection *conn = empathy_account_chooser_get_connection ( EMPATHY_ACCOUNT_CHOOSER (self->priv->account_chooser)); const char *identifiers[2] = { NULL, }; identifiers[0] = gtk_entry_get_text ( GTK_ENTRY (self->priv->add_contact_entry)); DEBUG ("Looking up handle for '%s' on %s", identifiers[0], get_pretty_conn_name (conn)); tp_connection_get_contacts_by_id (conn, 1, identifiers, 0, NULL, block_contact_got_contact, g_strdup (identifiers[0]), NULL, G_OBJECT (self)); gtk_entry_set_text (GTK_ENTRY (self->priv->add_contact_entry), ""); gtk_widget_hide (self->priv->info_bar); }