diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2019-07-01 20:52:40 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2019-07-11 23:21:00 +0200 |
commit | de2c24ec440c0a9f618f6c83b34a8bdf67d10fc2 (patch) | |
tree | 72b72c694136bc097ab8039a92d61faf1732081a /src | |
parent | 13b4c9f6ac91baa89a37135cef40b04d2ad2ca1b (diff) |
call-list: allow getting call object by DBus path
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-call-list.c | 13 | ||||
-rw-r--r-- | src/mm-call-list.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/mm-call-list.c b/src/mm-call-list.c index e4798d47..e131d20e 100644 --- a/src/mm-call-list.c +++ b/src/mm-call-list.c @@ -135,6 +135,19 @@ cmp_call_by_path (MMBaseCall *call, return g_strcmp0 (mm_base_call_get_path (call), path); } +MMBaseCall * +mm_call_list_get_call (MMCallList *self, + const gchar *call_path) +{ + GList *l; + + l = g_list_find_custom (self->priv->list, + (gpointer)call_path, + (GCompareFunc)cmp_call_by_path); + + 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 0555f48b..3f85d1d4 100644 --- a/src/mm-call-list.h +++ b/src/mm-call-list.h @@ -64,6 +64,9 @@ guint mm_call_list_get_count (MMCallList *self); void mm_call_list_add_call (MMCallList *self, MMBaseCall *call); +MMBaseCall *mm_call_list_get_call (MMCallList *self, + const gchar *call_path); + gboolean mm_call_list_delete_call (MMCallList *self, const gchar *call_path, GError **error); |