if (GNUNET_YES == pmsg->is_host)
{
- struct GNUNET_SOCIAL_HostConnection *hconn = GNUNET_malloc (sizeof (*hconn));
- hconn->app = app;
- hconn->plc_msg = *pmsg;
- if (NULL != app->host_cb)
+ if (NULL != app->host_cb) {
+ struct GNUNET_SOCIAL_HostConnection *hconn = GNUNET_malloc (sizeof (*hconn));
+ hconn->app = app;
+ hconn->plc_msg = *pmsg;
app->host_cb (app->cb_cls, hconn, ego, &pmsg->place_pub_key, pmsg->place_state);
+ // FIXME: should this have a GNUNET_free (hconn) here?
+ }
}
- else
+ else if (NULL != app->guest_cb)
{
struct GNUNET_SOCIAL_GuestConnection *gconn = GNUNET_malloc (sizeof (*gconn));
gconn->app = app;
gconn->plc_msg = *pmsg;
- if (NULL != app->guest_cb)
- app->guest_cb (app->cb_cls, gconn, ego, &pmsg->place_pub_key, pmsg->place_state);
+ app->guest_cb (app->cb_cls, gconn, ego, &pmsg->place_pub_key, pmsg->place_state);
+ // GNUNET_free (gconn); // FIXME: is this correct here? apparently not!
}
}
* Application handle.
* @param ego
* Identity of the host.
- * @param place_key
- * Private-public key pair of the place.
- * NULL to generate a key.
* @param policy
* Policy specifying entry and history restrictions for the place.
* @param slicer
* @param cls
* Closure for the callbacks.
*
- * @return Handle for the host.
+ * @return Handle for the host. This handle contains the pubkey.
*/
struct GNUNET_SOCIAL_Host *
GNUNET_SOCIAL_host_enter (const struct GNUNET_SOCIAL_App *app,
* Configuration.
* @param id
* Application ID.
- * @param notify_host
+ * @param ego_cb
+ * Function to notify about an available ego.
+ * @param host_cb
* Function to notify about a place entered as host.
- * @param notify_guest
- * Function to notify about a place entered as guest..
- * @param notify_cls
+ * @param guest_cb
+ * Function to notify about a place entered as guest.
+ * @param cls
* Closure for the callbacks.
*
* @return Handle that can be used to stop listening.
*
* @param app
* Application handle.
+ * @param disconnect_cb
+ * Disconnect callback.
+ * @param disconnect_cls
+ * Disconnect closure.
*/
void
GNUNET_SOCIAL_app_disconnect (struct GNUNET_SOCIAL_App *app,