sms: new method to check if the SMS has a given part

This commit is contained in:
Aleksander Morgado
2012-03-15 14:14:59 +01:00
parent c938a25ca7
commit ba0a622616
2 changed files with 22 additions and 0 deletions
+18
View File
@@ -138,6 +138,24 @@ mm_sms_multipart_is_complete (MMSms *self)
/*****************************************************************************/
static guint
cmp_sms_part_index (MMSmsPart *part,
gpointer user_data)
{
return (GPOINTER_TO_UINT (user_data) - mm_sms_part_get_index (part));
}
gboolean
mm_sms_has_part_index (MMSms *self,
guint index)
{
return !!g_list_find_custom (self->priv->parts,
GUINT_TO_POINTER (index),
(GCompareFunc)cmp_sms_part_index);
}
/*****************************************************************************/
static guint
cmp_sms_part_sequence (MMSmsPart *a,
MMSmsPart *b)
+4
View File
@@ -66,6 +66,10 @@ gboolean mm_sms_multipart_take_part (MMSms *self,
void mm_sms_export (MMSms *self);
const gchar *mm_sms_get_path (MMSms *self);
gboolean mm_sms_has_part_index (MMSms *self,
guint index);
gboolean mm_sms_is_multipart (MMSms *self);
guint mm_sms_get_multipart_reference (MMSms *self);
gboolean mm_sms_multipart_is_complete (MMSms *self);