ModestMailOperation *mail_op;
tny_header_set_flag (header, TNY_HEADER_FLAG_SEEN);
+ modest_platform_emit_msg_read_changed_signal (msg_uid, TRUE);
/* Sync folder, we need this to save the seen flag */
mail_op = modest_mail_operation_new (NULL);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
{
return;
}
+
+void
+modest_platform_emit_msg_read_changed_signal (const gchar *msg_uid,
+ gboolean is_read)
+{
+ return;
+}
priv->x_coord, priv->y_coord);
if (header) {
+ gchar *uid;
tny_header_set_flag (header, TNY_HEADER_FLAG_SEEN);
+ uid = modest_tny_folder_get_header_unique_id (header);
+ modest_platform_emit_msg_read_changed_signal (uid, TRUE);
+ g_free (uid);
g_object_unref (header);
}
}
priv->x_coord, priv->y_coord);
if (header) {
+ gchar *uid;
tny_header_unset_flag (header, TNY_HEADER_FLAG_SEEN);
+ uid = modest_tny_folder_get_header_unique_id (header);
+ modest_platform_emit_msg_read_changed_signal (uid, FALSE);
+ g_free (uid);
g_object_unref (header);
}
}
}
/* Mark header as read */
- if (!(tny_header_get_flags (header) & TNY_HEADER_FLAG_SEEN))
+ if (!(tny_header_get_flags (header) & TNY_HEADER_FLAG_SEEN)) {
+ gchar *uid;
+
tny_header_set_flag (header, TNY_HEADER_FLAG_SEEN);
+ uid = modest_tny_folder_get_header_unique_id (header);
+ modest_platform_emit_msg_read_changed_signal (uid, TRUE);
+ g_free (uid);
+ }
/* Set new message */
if (priv->msg_view != NULL && TNY_IS_MSG_VIEW (priv->msg_view)) {
modest_dbus_emit_account_removed_signal (con, account_id);
}
+void
+modest_platform_emit_msg_read_changed_signal (const gchar *msg_uid,
+ gboolean is_read)
+{
+ DBusConnection *con;
+
+ con = modest_platform_get_dbus_connection ();
+ if (!con) return;
+
+ modest_dbus_emit_msg_read_changed_signal (con, msg_uid, is_read);
+}
}
/* Mark header as read */
- if (!(tny_header_get_flags (header) & TNY_HEADER_FLAG_SEEN))
+ if (!(tny_header_get_flags (header) & TNY_HEADER_FLAG_SEEN)) {
+ gchar *uid;
+
tny_header_set_flag (header, TNY_HEADER_FLAG_SEEN);
+ uid = modest_tny_folder_get_header_unique_id (header);
+ modest_platform_emit_msg_read_changed_signal (uid, TRUE);
+ g_free (uid);
+ }
/* Set new message */
if (priv->msg_view != NULL && TNY_IS_MSG_VIEW (priv->msg_view)) {
modest_dbus_emit_account_removed_signal (con, account_id);
}
+
+void
+modest_platform_emit_msg_read_changed_signal (const gchar *msg_uid,
+ gboolean is_read)
+{
+ DBusConnection *con;
+
+ con = modest_platform_get_dbus_connection ();
+ if (!con) return;
+
+ modest_dbus_emit_msg_read_changed_signal (con, msg_uid, is_read);
+}
void modest_platform_emit_folder_updated_signal (const gchar *account_id, const gchar *folder_id);
void modest_platform_emit_account_created_signal (const gchar *account_id);
void modest_platform_emit_account_removed_signal (const gchar *account_id);
+void modest_platform_emit_msg_read_changed_signal (const gchar *msg_uid, gboolean is_read);
G_END_DECLS
tny_header_set_flag (header, TNY_HEADER_FLAG_SEEN);
+ modest_platform_emit_msg_read_changed_signal (msg_id, TRUE);
+
tny_folder_sync_async (priv->sentbox, FALSE, NULL, NULL, NULL);
/* Get status info */
gpointer user_data)
{
TnyHeaderFlags flags;
+ gchar *uid;
g_return_if_fail (TNY_IS_HEADER(header));
flags = tny_header_get_flags (header);
if (flags & TNY_HEADER_FLAG_SEEN) return;
tny_header_set_flag (header, TNY_HEADER_FLAG_SEEN);
+ uid = modest_tny_folder_get_header_unique_id (header);
+ modest_platform_emit_msg_read_changed_signal (uid, TRUE);
+ g_free (uid);
}
static void
flags = tny_header_get_flags (header);
if (flags & TNY_HEADER_FLAG_SEEN) {
+ gchar *uid;
+ uid = modest_tny_folder_get_header_unique_id (header);
tny_header_unset_flag (header, TNY_HEADER_FLAG_SEEN);
+ modest_platform_emit_msg_read_changed_signal (uid, FALSE);
}
}