Python plugin: Include information about default account
authorHolger Berndt <hb@claws-mail.org>
Sat, 27 Jul 2013 14:46:43 +0000 (16:46 +0200)
committerHolger Berndt <hb@claws-mail.org>
Sat, 27 Jul 2013 14:50:09 +0000 (16:50 +0200)
src/plugins/python/accounttype.c

index d82717acb357db1b106140ef3756338b1f051d79..56c7c7be6232703001e6d8e6e594ea855597cf67 100644 (file)
@@ -75,6 +75,14 @@ static PyObject* get_address(clawsmail_AccountObject *self, void *closure)
   return self->address;
 }
 
+static PyObject* get_is_default(clawsmail_AccountObject *self, void *closure)
+{
+  if(self->account->is_default)
+    Py_RETURN_TRUE;
+  else
+    Py_RETURN_FALSE;
+}
+
 static PyGetSetDef Account_getset[] = {
     {"account_name", (getter)get_account_name, (setter)NULL,
       "account_name - name of the account", NULL},
@@ -82,6 +90,9 @@ static PyGetSetDef Account_getset[] = {
     {"address", (getter)get_address, (setter)NULL,
      "address - address of the account", NULL},
 
+    {"is_default", (getter)get_is_default, (setter)NULL,
+     "is_default - whether this account is the default account", NULL},
+
     {NULL}
 };