#include "dbus.h"
#include "log.h"
#include "map_ap.h"
+#include "map-event.h"
#include "map.h"
#include "transfer.h"
g_free(path);
}
+static void map_handle_notification(struct map_event *event, void *user_data)
+{
+ struct map_data *map = user_data;
+
+ DBG("Event report for %s:%d", obc_session_get_destination(map->session),
+ map->mas_instance_id);
+ DBG("type=%x, handle=%s, folder=%s, old_folder=%s, msg_type=%s",
+ event->type, event->handle, event->folder,
+ event->old_folder, event->msg_type);
+}
+
static bool set_notification_registration(struct map_data *map, bool status)
{
struct obc_transfer *transfer;
GError *err = NULL;
GObexApparam *apparam;
char contents[2];
+ const char *address;
+
+ address = obc_session_get_destination(map->session);
+ if (!address || map->mas_instance_id < 0)
+ return FALSE;
+
+ if (status) {
+ map_register_event_handler(map->session, map->mas_instance_id,
+ &map_handle_notification, map);
+ } else {
+ map_unregister_event_handler(map->session,
+ map->mas_instance_id);
+ }
contents[0] = FILLER_BYTE;
contents[1] = '\0';