static void connection_ready_cb (TpConnection *connection, const GError *error, gpointer user_data) { EmpathyTpContactFactory *tp_factory = EMPATHY_TP_CONTACT_FACTORY (user_data); EmpathyTpContactFactoryPriv *priv = GET_PRIV (tp_factory); if (error != NULL) goto out; /* FIXME: This should be moved to TpContact */ tp_cli_connection_interface_avatars_connect_to_avatar_updated (priv->connection, tp_contact_factory_avatar_updated_cb, NULL, NULL, G_OBJECT (tp_factory), NULL); tp_cli_connection_interface_avatars_connect_to_avatar_retrieved (priv->connection, tp_contact_factory_avatar_retrieved_cb, NULL, NULL, G_OBJECT (tp_factory), NULL); tp_cli_connection_interface_capabilities_connect_to_capabilities_changed (priv->connection, tp_contact_factory_capabilities_changed_cb, NULL, NULL, G_OBJECT (tp_factory), NULL); tp_cli_connection_interface_location_connect_to_location_updated (priv->connection, tp_contact_factory_location_updated_cb, NULL, NULL, G_OBJECT (tp_factory), NULL); tp_cli_connection_interface_avatars_call_get_avatar_requirements (priv->connection, -1, tp_contact_factory_got_avatar_requirements_cb, NULL, NULL, G_OBJECT (tp_factory)); tp_cli_dbus_properties_call_get (priv->connection, -1, TP_IFACE_CONNECTION_INTERFACE_REQUESTS, "RequestableChannelClasses", get_requestable_channel_classes_cb, NULL, NULL, G_OBJECT (tp_factory)); out: g_object_unref (tp_factory); }
NS_IMETHODIMP csTpConnectionInterfaceLocation::ConnectToLocationUpdated(csITpConnectionInterfaceLocationLocationUpdatedObserver *observer) { if (!m_Proxy) return NS_ERROR_NOT_INITIALIZED; NS_ENSURE_ARG_POINTER(observer); if (!m_LocationUpdatedObservers) { m_LocationUpdatedObservers = do_CreateInstance(NS_ARRAY_CONTRACTID); tp_cli_connection_interface_location_connect_to_location_updated(m_Proxy, LocationUpdatedSignalCallback, this, NULL, NULL, NULL); } m_LocationUpdatedObservers->AppendElement(observer, PR_FALSE); return NS_OK; }