diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-call-list.c | 20 | ||||
-rw-r--r-- | src/mm-call-list.h | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/mm-call-list.c b/src/mm-call-list.c index e131d20e..66e8382c 100644 --- a/src/mm-call-list.c +++ b/src/mm-call-list.c @@ -148,6 +148,26 @@ mm_call_list_get_call (MMCallList *self, return (l ? MM_BASE_CALL (l->data) : NULL); } +static guint +cmp_call_by_index (MMBaseCall *call, + guint8 *index) +{ + return mm_base_call_get_index (call) - *index; +} + +MMBaseCall * +mm_call_list_get_call_by_index (MMCallList *self, + guint8 index) +{ + GList *l; + + l = g_list_find_custom (self->priv->list, + (gpointer)&index, + (GCompareFunc)cmp_call_by_index); + + return (l ? MM_BASE_CALL (l->data) : NULL); +} + gboolean mm_call_list_delete_call (MMCallList *self, const gchar *call_path, diff --git a/src/mm-call-list.h b/src/mm-call-list.h index 1183129e..f77a5b37 100644 --- a/src/mm-call-list.h +++ b/src/mm-call-list.h @@ -68,6 +68,9 @@ void mm_call_list_add_call (MMCallList *self, MMBaseCall *mm_call_list_get_call (MMCallList *self, const gchar *call_path); +MMBaseCall *mm_call_list_get_call_by_index (MMCallList *self, + guint8 index); + gboolean mm_call_list_delete_call (MMCallList *self, const gchar *call_path, GError **error); |