[Commits] [SCM] claws branch, master, updated. 3.12.0-48-gb20b2b3
holger at claws-mail.org
holger at claws-mail.org
Wed Aug 12 20:14:36 CEST 2015
The branch, master has been updated
via b20b2b3508765ce95842aff8e13feb86ff2b599a (commit)
from c1172c548a18b4161b965b57371239ca38e2c565 (commit)
Summary of changes:
src/plugins/python/messageinfotype.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
- Log -----------------------------------------------------------------
commit b20b2b3508765ce95842aff8e13feb86ff2b599a
Author: Holger Berndt <hb at claws-mail.org>
Date: Wed Aug 12 20:14:17 2015 +0200
Python plugin: Add Folder to MessageInfo objects
diff --git a/src/plugins/python/messageinfotype.c b/src/plugins/python/messageinfotype.c
index 3c7194a..ea98320 100644
--- a/src/plugins/python/messageinfotype.c
+++ b/src/plugins/python/messageinfotype.c
@@ -21,6 +21,7 @@
#endif
#include "messageinfotype.h"
+#include "foldertype.h"
#include "common/tags.h"
#include "common/defs.h"
@@ -306,6 +307,16 @@ static int set_flag(clawsmail_MessageInfoObject *self, PyObject *value, void *cl
return 0;
}
+
+static PyObject* get_Folder(clawsmail_MessageInfoObject *self, void *closure)
+{
+ if(self->msginfo && self->msginfo->folder) {
+ return clawsmail_folder_new(self->msginfo->folder);
+ }
+ Py_RETURN_NONE;
+}
+
+
static PyMethodDef MessageInfo_methods[] = {
{"is_new", is_new, METH_NOARGS,
"is_new() - checks if the message is new\n"
@@ -407,7 +418,10 @@ static PyGetSetDef MessageInfo_getset[] = {
{"forwarded", (getter)get_flag, (setter)NULL,
"forwarded - Forwarded-flag of the message", GINT_TO_POINTER(MSG_FORWARDED)},
- {NULL}
+ {"Folder", (getter)get_Folder, (setter)NULL,
+ "Folder - Folder in which the message is contained", NULL},
+
+ {NULL}
};
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list