summaryrefslogtreecommitdiff
path: root/obexd
diff options
context:
space:
mode:
authorChristian Fetzer <christian.fetzer@bmw-carit.de>2013-09-24 16:16:06 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-10-03 16:46:41 +0300
commitc55ebae4311dd4a4e5d2a019ca6befee3ea30b97 (patch)
tree0d8694c2aa06cf29d2bcc81e2e9bd296044e3958 /obexd
parent85bf0046da63d31b27847772df5ca2c207b687d8 (diff)
obexd: Handle message shift and message deleted events
Update Folder propery if the message has been shifted or deleted.
Diffstat (limited to 'obexd')
-rw-r--r--obexd/client/map.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/obexd/client/map.c b/obexd/client/map.c
index 20946fe63..68bd99879 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -1857,6 +1857,29 @@ static void map_handle_status_changed(struct map_data *map,
"Status");
}
+static void map_handle_folder_changed(struct map_data *map,
+ struct map_event *event,
+ const char *folder)
+{
+ struct map_msg *msg;
+
+ if (!folder)
+ return;
+
+ msg = g_hash_table_lookup(map->messages, event->handle);
+ if (!msg)
+ return;
+
+ if (g_strcmp0(msg->folder, folder) == 0)
+ return;
+
+ g_free(msg->folder);
+ msg->folder = g_strdup(folder);
+
+ g_dbus_emit_property_changed(conn, msg->path, MAP_MSG_INTERFACE,
+ "Folder");
+}
+
static void map_handle_notification(struct map_event *event, void *user_data)
{
struct map_data *map = user_data;
@@ -1883,6 +1906,12 @@ static void map_handle_notification(struct map_event *event, void *user_data)
case MAP_ET_SENDING_FAILURE:
map_handle_status_changed(map, event, "sending-failure");
break;
+ case MAP_ET_MESSAGE_DELETED:
+ map_handle_folder_changed(map, event, "/telecom/msg/deleted");
+ break;
+ case MAP_ET_MESSAGE_SHIFT:
+ map_handle_folder_changed(map, event, event->folder);
+ break;
default:
break;
}