talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 98b03dfda49ad0c206a73b6d8741587b6b5d60b5
parent 3e1e674b8a73109200e23b0e2520f42e8d63155b
Author: Holger Berndt <hb@claws-mail.org>
Date:   Sun,  7 Apr 2013 03:47:40 +0200

Python plugin: Add Cc field to messageinfo objects

Diffstat:
Msrc/plugins/python/messageinfotype.c | 19++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/plugins/python/messageinfotype.c b/src/plugins/python/messageinfotype.c @@ -36,6 +36,7 @@ typedef struct { PyObject_HEAD PyObject *from; PyObject *to; + PyObject *cc; PyObject *subject; PyObject *msgid; PyObject *filepath; @@ -47,6 +48,7 @@ static void MessageInfo_dealloc(clawsmail_MessageInfoObject* self) { Py_XDECREF(self->from); Py_XDECREF(self->to); + Py_XDECREF(self->cc); Py_XDECREF(self->subject); Py_XDECREF(self->msgid); self->ob_type->tp_free((PyObject*)self); @@ -61,6 +63,9 @@ static int MessageInfo_init(clawsmail_MessageInfoObject *self, PyObject *args, P self->to = Py_None; Py_INCREF(Py_None); + self->cc = Py_None; + + Py_INCREF(Py_None); self->subject = Py_None; Py_INCREF(Py_None); @@ -209,7 +214,7 @@ static PyMethodDef MessageInfo_methods[] = { "\n" "Returns True if the new flag of the message is set."}, - {"is_unread", is_unread, METH_NOARGS, + {"is_unread", is_unread, METH_NOARGS, "is_unread() - checks if the message is unread\n" "\n" "Returns True if the unread flag of the message is set."}, @@ -255,11 +260,14 @@ static PyMethodDef MessageInfo_methods[] = { }; static PyMemberDef MessageInfo_members[] = { - {"From", T_OBJECT_EX, offsetof(clawsmail_MessageInfoObject, from), 0, - "From - the From header of the message"}, + { "From", T_OBJECT_EX, offsetof(clawsmail_MessageInfoObject, from), 0, + "From - the From header of the message" }, + + { "To", T_OBJECT_EX, offsetof(clawsmail_MessageInfoObject, to), 0, + "To - the To header of the message" }, - {"To", T_OBJECT_EX, offsetof(clawsmail_MessageInfoObject, to), 0, - "To - the To header of the message"}, + { "Cc", T_OBJECT_EX, offsetof(clawsmail_MessageInfoObject, cc), 0, + "Cc - the Cc header of the message" }, {"Subject", T_OBJECT_EX, offsetof(clawsmail_MessageInfoObject, subject), 0, "Subject - the subject header of the message"}, @@ -347,6 +355,7 @@ static gboolean update_members(clawsmail_MessageInfoObject *ff, MsgInfo *msginfo MSGINFO_STRING_TO_PYTHON_MESSAGEINFO_MEMBER(msginfo->from, "From"); MSGINFO_STRING_TO_PYTHON_MESSAGEINFO_MEMBER(msginfo->to, "To"); + MSGINFO_STRING_TO_PYTHON_MESSAGEINFO_MEMBER(msginfo->cc, "Cc"); MSGINFO_STRING_TO_PYTHON_MESSAGEINFO_MEMBER(msginfo->subject, "Subject"); MSGINFO_STRING_TO_PYTHON_MESSAGEINFO_MEMBER(msginfo->msgid, "MessageID");