* mu-msg.[ch]: add mu_msg_is_readable

This commit is contained in:
Dirk-Jan C. Binnema 2011-08-03 23:03:58 +03:00
parent d291c5a9f5
commit 42d69b7501
2 changed files with 21 additions and 0 deletions

View File

@ -671,6 +671,17 @@ mu_msg_cmp (MuMsg *m1, MuMsg *m2, MuMsgFieldId mfid)
}
gboolean
mu_msg_is_readable (MuMsg *self)
{
g_return_val_if_fail (self, FALSE);
return (access (get_str_field (self, MU_MSG_FIELD_ID_PATH), R_OK)
== 0) ? TRUE : FALSE;
}
enum _MaildirType {

View File

@ -358,6 +358,16 @@ int mu_msg_cmp (MuMsg *m1, MuMsg *m2, MuMsgFieldId mfid);
/**
* check whether there there's a readable file behind this message
*
* @param self a MuMsg*
*
* @return TRUE if the message file is readable, FALSE otherwise
*/
gboolean mu_msg_is_readable (MuMsg *self);
/**
* convert the msg to a Lisp symbolic expression (for further processing in
* e.g. emacs)