aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/em-composer-utils.c25
-rw-r--r--mail/em-event.c7
-rw-r--r--mail/em-event.h7
-rw-r--r--mail/em-folder-view.c2
-rw-r--r--plugins/groupwise-features/mail-send-options.c20
-rw-r--r--plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml11
6 files changed, 55 insertions, 17 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 11f4272cf8..8b77c716a5 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -2336,18 +2336,7 @@ em_utils_reply_to_message(CamelFolder *folder, const gchar *uid, CamelMimeMessag
g_return_val_if_fail(message != NULL, NULL);
- /** @Event: message.replying
- * @Title: Message being replied to
- * @Target: EMEventTargetMessage
- *
- * message.replying is emitted when a user starts replying to a message.
- */
-
- eme = em_event_peek();
- target = em_event_target_new_message(eme, folder, message, uid,
- mode == REPLY_MODE_ALL ? EM_EVENT_MESSAGE_REPLY_ALL : 0);
- e_event_emit((EEvent *)eme, "message.replying", (EEventTarget *)target);
-
+
to = camel_internet_address_new();
cc = camel_internet_address_new();
@@ -2385,6 +2374,18 @@ em_utils_reply_to_message(CamelFolder *folder, const gchar *uid, CamelMimeMessag
composer_set_body (composer, message, source);
+ /** @Event: message.replying
+ * @Title: Message being replied to
+ * @Target: EMEventTargetMessage
+ *
+ * message.replying is emitted when a user starts replying to a message.
+ */
+
+ eme = em_event_peek();
+ target = em_event_target_new_message(eme, folder, message, uid,
+ mode == REPLY_MODE_ALL ? EM_EVENT_MESSAGE_REPLY_ALL | EM_EVENT_MESSAGE_REPLY : EM_EVENT_MESSAGE_REPLY, composer);
+ e_event_emit((EEvent *)eme, "message.replying", (EEventTarget *)target);
+
em_composer_utils_setup_callbacks (composer, folder, uid, flags, flags, NULL, NULL);
composer_set_no_change (composer, TRUE, FALSE);
diff --git a/mail/em-event.c b/mail/em-event.c
index b1bf7a7d05..4e79c31d08 100644
--- a/mail/em-event.c
+++ b/mail/em-event.c
@@ -76,6 +76,8 @@ eme_target_free(EEvent *ep, EEventTarget *t)
if (s->message)
camel_object_unref(s->message);
g_free(s->uid);
+ if (s->composer)
+ g_object_unref (s->composer);
break; }
case EM_EVENT_TARGET_COMPOSER : {
EMEventTargetComposer *s = (EMEventTargetComposer *)t;
@@ -169,7 +171,7 @@ em_event_target_new_composer (EMEvent *eme, const EMsgComposer *composer, guint3
}
EMEventTargetMessage *
-em_event_target_new_message(EMEvent *eme, CamelFolder *folder, CamelMimeMessage *message, const gchar *uid, guint32 flags)
+em_event_target_new_message(EMEvent *eme, CamelFolder *folder, CamelMimeMessage *message, const gchar *uid, guint32 flags, EMsgComposer *composer)
{
EMEventTargetMessage *t = e_event_target_new(&eme->popup, EM_EVENT_TARGET_MESSAGE, sizeof(*t));
@@ -181,6 +183,8 @@ em_event_target_new_message(EMEvent *eme, CamelFolder *folder, CamelMimeMessage
if (message)
camel_object_ref(message);
t->target.mask = ~flags;
+ if (composer)
+ t->composer = g_object_ref(G_OBJECT(composer));
return t;
}
@@ -233,6 +237,7 @@ static const EEventHookTargetMask emeh_composer_masks[] = {
static const EEventHookTargetMask emeh_message_masks[] = {
{ "replyall", EM_EVENT_MESSAGE_REPLY_ALL },
+ { "reply", EM_EVENT_MESSAGE_REPLY },
{ NULL }
};
diff --git a/mail/em-event.h b/mail/em-event.h
index e2235a122a..6b6a5cf675 100644
--- a/mail/em-event.h
+++ b/mail/em-event.h
@@ -57,7 +57,8 @@ enum {
/* Flags that describe TARGET_MESSAGE */
enum {
- EM_EVENT_MESSAGE_REPLY_ALL = 1<< 0
+ EM_EVENT_MESSAGE_REPLY_ALL = 1<< 0,
+ EM_EVENT_MESSAGE_REPLY = 1<< 1
};
/* Flags that describe TARGET_COMPOSER */
@@ -92,6 +93,7 @@ struct _EMEventTargetMessage {
CamelFolder *folder;
gchar *uid;
CamelMimeMessage *message;
+ EMsgComposer *composer;
};
typedef struct _EMEventTargetComposer EMEventTargetComposer;
@@ -150,7 +152,8 @@ EMEvent *em_event_peek(void);
EMEventTargetFolder *em_event_target_new_folder(EMEvent *emp, const gchar *uri, guint32 flags);
EMEventTargetFolderBrowser *em_event_target_new_folder_browser (EMEvent *eme, EMFolderBrowser *emfb);
EMEventTargetComposer *em_event_target_new_composer(EMEvent *emp, const EMsgComposer *composer, guint32 flags);
-EMEventTargetMessage *em_event_target_new_message(EMEvent *emp, CamelFolder *folder, CamelMimeMessage *message, const gchar *uid, guint32 flags);
+EMEventTargetMessage *em_event_target_new_message(EMEvent *emp, CamelFolder *folder, CamelMimeMessage *message, const gchar *uid, guint32 flags,
+ EMsgComposer *composer);
EMEventTargetSendReceive * em_event_target_new_send_receive(EMEvent *eme, GtkWidget *table, gpointer data, gint row, guint32 flags);
EMEventTargetCustomIcon * em_event_target_new_custom_icon(EMEvent *eme, GtkTreeStore *store, GtkTreeIter *iter, const gchar *uri, guint32 flags);
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index de87a10ed0..5923e6ef9c 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -2462,7 +2462,7 @@ emfv_list_done_message_selected(CamelFolder *folder, const gchar *uid, CamelMime
*/
/* TODO: do we emit a message.reading with no message when we're looking at nothing or don't care? */
eme = em_event_peek();
- target = em_event_target_new_message(eme, folder, msg, uid, 0);
+ target = em_event_target_new_message(eme, folder, msg, uid, 0, NULL);
e_event_emit((EEvent *)eme, "message.reading", (EEventTarget *)target);
em_format_format((EMFormat *)emfv->preview, folder, uid, msg);
diff --git a/plugins/groupwise-features/mail-send-options.c b/plugins/groupwise-features/mail-send-options.c
index 4faaf9bbc6..701205f04c 100644
--- a/plugins/groupwise-features/mail-send-options.c
+++ b/plugins/groupwise-features/mail-send-options.c
@@ -44,6 +44,7 @@
static ESendOptionsDialog * dialog = NULL;
void org_gnome_composer_send_options (EPlugin *ep, EMEventTargetComposer *t);
+void org_gnome_composer_message_reply (EPlugin *ep, EMEventTargetMessage *t);
static time_t
add_day_to_time (time_t time, gint days)
@@ -171,3 +172,22 @@ org_gnome_composer_send_options (EPlugin *ep, EMEventTargetComposer *t)
G_CALLBACK (send_options_commit), dialog);
}
+void
+org_gnome_composer_message_reply (EPlugin *ep, EMEventTargetMessage *t)
+{
+ EMsgComposer *comp = (struct _EMsgComposer *)t->composer ;
+ EComposerHeaderTable *table;
+ EAccount *account = NULL;
+ char *temp = NULL;
+
+ table = e_msg_composer_get_header_table (comp);
+ account = e_composer_header_table_get_account (table);
+ if (!account)
+ return;
+
+ temp = strstr (account->transport->url, "groupwise") ;
+ if (!temp) {
+ return;
+ }
+ e_msg_composer_add_header (comp, "X-GW-ORIG-ITEM-ID", t->uid);
+}
diff --git a/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml b/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml
index 8bb6651acf..ea4f06a6e7 100644
--- a/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml
+++ b/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml
@@ -72,7 +72,16 @@
enable="sendoption"
/>
</hook>
-
+
+ <hook class="org.gnome.evolution.mail.events:1.0">
+ <event
+ id="message.replying"
+ handle="org_gnome_composer_message_reply"
+ target="message"
+ enable="reply"
+ />
+ </hook>
+
<hook class="org.gnome.evolution.mail.config:1.0">
<group id="org.gnome.evolution.mail.config.accountEditor"
target="account" commit = "proxy_commit" abort="proxy_abort">