Re: [PATCH 5/5] obexd: Handle MAP Event Report v1.1 and v1.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ajay,

On Tue, Dec 10, 2019 at 1:42 PM Ajay Kishore <ajay.kishore@xxxxxxxxx> wrote:
>
> Changes made to add handler function for the corresponding
> events mentioned in extended event reports 1.1 and 1.2.
>
> Signed-off-by: Ajay Kishore <ajay.kishore@xxxxxxxxx>
> ---
>  obexd/client/map-event.h |  8 +++++++-
>  obexd/client/map.c       | 24 ++++++++++++++++++++++++
>  2 files changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/obexd/client/map-event.h b/obexd/client/map-event.h
> index 5414b26..c41bb67 100644
> --- a/obexd/client/map-event.h
> +++ b/obexd/client/map-event.h
> @@ -32,7 +32,13 @@ enum map_event_type {
>         MAP_ET_MEMORY_FULL,
>         MAP_ET_MEMORY_AVAILABLE,
>         MAP_ET_MESSAGE_DELETED,
> -       MAP_ET_MESSAGE_SHIFT
> +       MAP_ET_MESSAGE_SHIFT,
> +       MAP_ET_READ_STATUS_CHANGED,
> +       MAP_ET_MESSAGE_REMOVED,
> +       MAP_ET_MESSAGE_EXTENDED_DATA_CHANGED,
> +       MAP_ET_PARTICIPANT_PRESENCE_CHANGED,
> +       MAP_ET_PARTICIPANT_CHAT_STATE_CHANGED,
> +       MAP_ET_CONVERSATION_CHANGED
>  };
>
>  struct map_event {
> diff --git a/obexd/client/map.c b/obexd/client/map.c
> index b65131a..b1b4b38 100644
> --- a/obexd/client/map.c
> +++ b/obexd/client/map.c
> @@ -2550,6 +2550,17 @@ static void map_handle_folder_changed(struct map_data *map,
>                                                                 "Folder");
>  }
>
> +static void map_handle_remove_message(struct map_data *map,
> +                                               struct map_event *event)
> +{
> +       struct map_msg *msg;
> +
> +       msg = g_hash_table_lookup(map->messages, &event->handle);
> +
> +       if (msg)
> +               g_hash_table_remove(map->messages, &event->handle);

I believe you only need the call to remove here otherwise we might
just be doing 2 lookups for no obvious reason since remove already
does that.

> +}
> +
>  static void map_handle_notification(struct map_event *event, void *user_data)
>  {
>         struct map_data *map = user_data;
> @@ -2582,6 +2593,19 @@ static void map_handle_notification(struct map_event *event, void *user_data)
>         case MAP_ET_MESSAGE_SHIFT:
>                 map_handle_folder_changed(map, event, event->folder);
>                 break;
> +       case MAP_ET_READ_STATUS_CHANGED:
> +               map_handle_status_changed(map, event, "read");
> +               break;
> +       case MAP_ET_MESSAGE_REMOVED:
> +               map_handle_remove_message(map, event);
> +               break;
> +       case MAP_ET_MESSAGE_EXTENDED_DATA_CHANGED:
> +               map_handle_status_changed(map, event,
> +                                       "message-extended-data-changed");
> +               break;
> +       case MAP_ET_PARTICIPANT_PRESENCE_CHANGED:
> +       case MAP_ET_PARTICIPANT_CHAT_STATE_CHANGED:
> +       case MAP_ET_CONVERSATION_CHANGED:
>         case MAP_ET_MEMORY_FULL:
>         case MAP_ET_MEMORY_AVAILABLE:
>         default:
> --
> 2.7.4
>


-- 
Luiz Augusto von Dentz



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux