projects
/
modest
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f5dbd4b
)
Emit dbus signal on changing SEEN flag.
author
José Dapena Paz
<jdapena@igalia.com>
Sat, 23 Jan 2010 20:07:14 +0000
(21:07 +0100)
committer
José Dapena Paz
<jdapena@igalia.com>
Tue, 26 Jan 2010 10:19:14 +0000
(11:19 +0100)
src/dbus_api/modest-dbus-callbacks.c
patch
|
blob
|
history
src/gnome/modest-platform.c
patch
|
blob
|
history
src/hildon2/modest-header-window.c
patch
|
blob
|
history
src/hildon2/modest-msg-view-window.c
patch
|
blob
|
history
src/hildon2/modest-platform.c
patch
|
blob
|
history
src/maemo/modest-msg-view-window.c
patch
|
blob
|
history
src/maemo/modest-platform.c
patch
|
blob
|
history
src/modest-platform.h
patch
|
blob
|
history
src/modest-tny-send-queue.c
patch
|
blob
|
history
src/modest-ui-actions.c
patch
|
blob
|
history
diff --git
a/src/dbus_api/modest-dbus-callbacks.c
b/src/dbus_api/modest-dbus-callbacks.c
index
93a6932
..
11769ef
100644
(file)
--- a/
src/dbus_api/modest-dbus-callbacks.c
+++ b/
src/dbus_api/modest-dbus-callbacks.c
@@
-537,6
+537,7
@@
find_msg_async_cb (TnyFolder *folder,
ModestMailOperation *mail_op;
tny_header_set_flag (header, TNY_HEADER_FLAG_SEEN);
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 (),
/* 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 (),
diff --git
a/src/gnome/modest-platform.c
b/src/gnome/modest-platform.c
index
8923c7e
..
c39064d
100644
(file)
--- a/
src/gnome/modest-platform.c
+++ b/
src/gnome/modest-platform.c
@@
-677,3
+677,10
@@
modest_platform_emit_account_removed_signal (const gchar *account_id)
{
return;
}
{
return;
}
+
+void
+modest_platform_emit_msg_read_changed_signal (const gchar *msg_uid,
+ gboolean is_read)
+{
+ return;
+}
diff --git
a/src/hildon2/modest-header-window.c
b/src/hildon2/modest-header-window.c
index
6c3d6a4
..
b44f12e
100644
(file)
--- a/
src/hildon2/modest-header-window.c
+++ b/
src/hildon2/modest-header-window.c
@@
-581,7
+581,11
@@
on_mark_read_csm_activated (GtkMenuItem *item,
priv->x_coord, priv->y_coord);
if (header) {
priv->x_coord, priv->y_coord);
if (header) {
+ gchar *uid;
tny_header_set_flag (header, TNY_HEADER_FLAG_SEEN);
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);
}
}
g_object_unref (header);
}
}
@@
-601,7
+605,11
@@
on_mark_unread_csm_activated (GtkMenuItem *item,
priv->x_coord, priv->y_coord);
if (header) {
priv->x_coord, priv->y_coord);
if (header) {
+ gchar *uid;
tny_header_unset_flag (header, TNY_HEADER_FLAG_SEEN);
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);
}
}
g_object_unref (header);
}
}
diff --git
a/src/hildon2/modest-msg-view-window.c
b/src/hildon2/modest-msg-view-window.c
index
1ad8d2f
..
f3ff4f0
100644
(file)
--- a/
src/hildon2/modest-msg-view-window.c
+++ b/
src/hildon2/modest-msg-view-window.c
@@
-2310,8
+2310,14
@@
view_msg_cb (ModestMailOperation *mail_op,
}
/* Mark header as 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);
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)) {
/* Set new message */
if (priv->msg_view != NULL && TNY_IS_MSG_VIEW (priv->msg_view)) {
diff --git
a/src/hildon2/modest-platform.c
b/src/hildon2/modest-platform.c
index
ff3934e
..
885427b
100644
(file)
--- a/
src/hildon2/modest-platform.c
+++ b/
src/hildon2/modest-platform.c
@@
-3208,3
+3208,14
@@
modest_platform_emit_account_removed_signal (const gchar *account_id)
modest_dbus_emit_account_removed_signal (con, account_id);
}
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);
+}
diff --git
a/src/maemo/modest-msg-view-window.c
b/src/maemo/modest-msg-view-window.c
index
54f69fc
..
a5fc2d6
100644
(file)
--- a/
src/maemo/modest-msg-view-window.c
+++ b/
src/maemo/modest-msg-view-window.c
@@
-2192,8
+2192,14
@@
view_msg_cb (ModestMailOperation *mail_op,
}
/* Mark header as 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);
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)) {
/* Set new message */
if (priv->msg_view != NULL && TNY_IS_MSG_VIEW (priv->msg_view)) {
diff --git
a/src/maemo/modest-platform.c
b/src/maemo/modest-platform.c
index
52f7206
..
ca67fa5
100644
(file)
--- a/
src/maemo/modest-platform.c
+++ b/
src/maemo/modest-platform.c
@@
-2302,3
+2302,15
@@
modest_platform_emit_account_removed_signal (const gchar *account_id)
modest_dbus_emit_account_removed_signal (con, account_id);
}
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);
+}
diff --git
a/src/modest-platform.h
b/src/modest-platform.h
index
b029780
..
4fab91f
100644
(file)
--- a/
src/modest-platform.h
+++ b/
src/modest-platform.h
@@
-567,6
+567,7
@@
DBusConnection* modest_platform_get_dbus_connection (void);
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_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
G_END_DECLS
diff --git
a/src/modest-tny-send-queue.c
b/src/modest-tny-send-queue.c
index
9e9586b
..
b3bd3b1
100644
(file)
--- a/
src/modest-tny-send-queue.c
+++ b/
src/modest-tny-send-queue.c
@@
-679,6
+679,8
@@
_on_msg_has_been_sent (TnySendQueue *self,
tny_header_set_flag (header, TNY_HEADER_FLAG_SEEN);
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 */
tny_folder_sync_async (priv->sentbox, FALSE, NULL, NULL, NULL);
/* Get status info */
diff --git
a/src/modest-ui-actions.c
b/src/modest-ui-actions.c
index
523d260
..
3b2ab68
100644
(file)
--- a/
src/modest-ui-actions.c
+++ b/
src/modest-ui-actions.c
@@
-398,12
+398,16
@@
headers_action_mark_as_read (TnyHeader *header,
gpointer user_data)
{
TnyHeaderFlags flags;
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);
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
}
static void
@@
-417,7
+421,10
@@
headers_action_mark_as_unread (TnyHeader *header,
flags = tny_header_get_flags (header);
if (flags & TNY_HEADER_FLAG_SEEN) {
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);
tny_header_unset_flag (header, TNY_HEADER_FLAG_SEEN);
+ modest_platform_emit_msg_read_changed_signal (uid, FALSE);
}
}
}
}