Patch: add proper implementation for get/set allow external images in bodystructure
- From: José Dapena Paz <jdapena igalia com>
- To: tinymail-devel-list <tinymail-devel-list gnome org>
- Subject: Patch: add proper implementation for get/set allow external images in bodystructure
- Date: Wed, 29 Oct 2008 08:40:49 +0100
Hi,
This patch just adds the proper implementation for get/set allow
external images in bodystructure tinymail implementation (it could lead
to crash using this.
Changelog entry would be:
* libtininymail-camel/tny-camel-bs-msg.[ch]:
Added implementation of methods get/set allow external images to avoid
crashes on code using this if using the bodystructure retrieve
strategy.
--
José Dapena Paz <jdapena igalia com>
Igalia
Index: libtinymail-camel/tny-camel-bs-msg.c
===================================================================
--- libtinymail-camel/tny-camel-bs-msg.c (revision 3789)
+++ libtinymail-camel/tny-camel-bs-msg.c (working copy)
@@ -151,6 +151,50 @@
return;
}
+static gboolean
+tny_camel_bs_msg_get_allow_external_images_default (TnyMsg *self)
+{
+ TnyCamelBsMsgPriv *priv = TNY_CAMEL_BS_MSG_GET_PRIVATE (self);
+ gboolean allow = FALSE;
+
+ if (priv->folder && priv->header) {
+ gchar *uid;
+ uid = tny_header_dup_uid (priv->header);
+ allow = _tny_camel_folder_get_allow_external_images (TNY_CAMEL_FOLDER(priv->folder),
+ uid);
+ g_free (uid);
+ }
+ return allow;
+}
+
+static gboolean
+tny_camel_bs_msg_get_allow_external_images (TnyMsg *self)
+{
+ return TNY_CAMEL_BS_MSG_GET_CLASS (self)->get_allow_external_images (self);
+}
+
+static void
+tny_camel_bs_msg_set_allow_external_images_default (TnyMsg *self, gboolean allow)
+{
+ TnyCamelBsMsgPriv *priv = TNY_CAMEL_BS_MSG_GET_PRIVATE (self);
+
+ if (priv->folder && priv->header) {
+ gchar *uid;
+ uid = tny_header_dup_uid (priv->header);
+ _tny_camel_folder_set_allow_external_images (TNY_CAMEL_FOLDER(priv->folder),
+ uid, allow);
+ g_free (uid);
+ }
+ return;
+}
+
+static void
+tny_camel_bs_msg_set_allow_external_images (TnyMsg *self, gboolean allow)
+{
+ TNY_CAMEL_BS_MSG_GET_CLASS (self)->set_allow_external_images (self, allow);
+ return;
+}
+
static TnyHeader*
tny_camel_bs_msg_get_header_default (TnyMsg *self)
{
@@ -249,6 +293,8 @@
klass->get_url_string= tny_camel_bs_msg_get_url_string;
klass->uncache_attachments= tny_camel_bs_msg_uncache_attachments;
klass->rewrite_cache= tny_camel_bs_msg_rewrite_cache;
+ klass->get_allow_external_images = tny_camel_bs_msg_get_allow_external_images;
+ klass->set_allow_external_images = tny_camel_bs_msg_set_allow_external_images;
return;
}
@@ -266,6 +312,8 @@
class->get_url_string= tny_camel_bs_msg_get_url_string_default;
class->uncache_attachments= tny_camel_bs_msg_uncache_attachments_default;
class->rewrite_cache= tny_camel_bs_msg_rewrite_cache_default;
+ class->get_allow_external_images = tny_camel_bs_msg_get_allow_external_images_default;
+ class->set_allow_external_images = tny_camel_bs_msg_set_allow_external_images_default;
object_class->finalize = tny_camel_bs_msg_finalize;
Index: libtinymail-camel/tny-camel-bs-msg.h
===================================================================
--- libtinymail-camel/tny-camel-bs-msg.h (revision 3789)
+++ libtinymail-camel/tny-camel-bs-msg.h (working copy)
@@ -56,6 +56,8 @@
gchar* (*get_url_string) (TnyMsg *self);
void (*uncache_attachments) (TnyMsg *self);
void (*rewrite_cache) (TnyMsg *self);
+ gboolean (*get_allow_external_images) (TnyMsg *self);
+ void (*set_allow_external_images) (TnyMsg *self, gboolean allow);
};
GType tny_camel_bs_msg_get_type (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]