NS_IMETHODIMP csTpConnectionInterfaceLocation::CallGetLocations(PRUint32 aContactsCount, PRUint32 *aContacts, csITpConnectionInterfaceLocationGetLocationsCB *cb) { if (!m_Proxy) return NS_ERROR_NOT_INITIALIZED; GArray *cContacts = g_array_new(false, false, sizeof(guint )); for (PRUint32 i=0; i<aContactsCount; i++) g_array_append_val(cContacts, aContacts[i]); NS_IF_ADDREF(cb); tp_cli_connection_interface_location_call_get_locations(m_Proxy, -1, cContacts, cb? GetLocationsResponse: NULL, cb? cb: NULL, NULL, NULL); return NS_OK; }
static void tp_contact_factory_add_contact (EmpathyTpContactFactory *tp_factory, EmpathyContact *contact) { EmpathyTpContactFactoryPriv *priv = GET_PRIV (tp_factory); TpHandle self_handle; TpHandle handle; GArray handles = {(gchar *) &handle, 1}; EmpathyCapabilities caps; /* Keep a weak ref to that contact */ g_object_weak_ref (G_OBJECT (contact), tp_contact_factory_weak_notify, tp_factory); priv->contacts = g_list_prepend (priv->contacts, contact); /* The contact keeps a ref to its factory */ g_object_set_data_full (G_OBJECT (contact), "empathy-factory", g_object_ref (tp_factory), g_object_unref); caps = empathy_contact_get_capabilities (contact); /* Set the FT capability */ if (priv->can_request_ft) { caps |= EMPATHY_CAPABILITIES_FT; } /* Set the Stream Tube capability */ if (priv->can_request_st) { caps |= EMPATHY_CAPABILITIES_STREAM_TUBE; } empathy_contact_set_capabilities (contact, caps); /* Set is-user property. Note that it could still be the handle is * different from the connection's self handle, in the case the handle * comes from a group interface. */ self_handle = tp_connection_get_self_handle (priv->connection); handle = empathy_contact_get_handle (contact); empathy_contact_set_is_user (contact, self_handle == handle); /* FIXME: This should be done by TpContact */ if (tp_proxy_has_interface_by_id (priv->connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS)) { tp_cli_connection_interface_avatars_call_get_known_avatar_tokens ( priv->connection, -1, &handles, tp_contact_factory_got_known_avatar_tokens, NULL, NULL, G_OBJECT (tp_factory)); } if (tp_proxy_has_interface_by_id (priv->connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_CAPABILITIES)) { tp_cli_connection_interface_capabilities_call_get_capabilities ( priv->connection, -1, &handles, tp_contact_factory_got_capabilities, NULL, NULL, G_OBJECT (tp_factory)); } if (tp_proxy_has_interface_by_id (TP_PROXY (priv->connection), TP_IFACE_QUARK_CONNECTION_INTERFACE_LOCATION)) { tp_cli_connection_interface_location_call_get_locations (priv->connection, -1, &handles, tp_contact_factory_got_locations, tp_factory, NULL, NULL); } DEBUG ("Contact added: %s (%d)", empathy_contact_get_id (contact), empathy_contact_get_handle (contact)); }