aboutsummaryrefslogtreecommitdiff
path: root/libmessaging-menu
diff options
context:
space:
mode:
Diffstat (limited to 'libmessaging-menu')
-rw-r--r--libmessaging-menu/messaging-menu-app.c21
-rw-r--r--libmessaging-menu/messaging-menu-app.h3
2 files changed, 24 insertions, 0 deletions
diff --git a/libmessaging-menu/messaging-menu-app.c b/libmessaging-menu/messaging-menu-app.c
index 7e61324..7fc9106 100644
--- a/libmessaging-menu/messaging-menu-app.c
+++ b/libmessaging-menu/messaging-menu-app.c
@@ -1363,6 +1363,27 @@ messaging_menu_app_append_message (MessagingMenuApp *app,
}
/**
+ * messaging_menu_app_get_message:
+ * @app: a #MessagingMenuApp
+ * @id: id of the message to retrieve
+ *
+ * Retrieves the message with @id, that was added with
+ * messaging_menu_app_append_message().
+ *
+ * Returns: (transfer none) (allow-none): the #MessagingMenuApp with
+ * @id, or %NULL
+ */
+MessagingMenuMessage *
+messaging_menu_app_get_message (MessagingMenuApp *app,
+ const gchar *id)
+{
+ g_return_val_if_fail (MESSAGING_MENU_IS_APP (app), NULL);
+ g_return_val_if_fail (id != NULL, NULL);
+
+ return g_hash_table_lookup (app->messages, id);
+}
+
+/**
* messaging_menu_app_remove_message:
* @app: a #MessagingMenuApp
* @msg: the #MessagingMenuMessage to remove
diff --git a/libmessaging-menu/messaging-menu-app.h b/libmessaging-menu/messaging-menu-app.h
index a2d27bc..c8097e1 100644
--- a/libmessaging-menu/messaging-menu-app.h
+++ b/libmessaging-menu/messaging-menu-app.h
@@ -149,6 +149,9 @@ void messaging_menu_app_append_message (MessagingMenuA
const gchar *source_id,
gboolean notify);
+MessagingMenuMessage * messaging_menu_app_get_message (MessagingMenuApp *app,
+ const gchar *id);
+
void messaging_menu_app_remove_message (MessagingMenuApp *app,
MessagingMenuMessage *msg);