diff options
author | Gary Kramlich <grim@reaperworld.com> | 2022-08-22 22:05:55 -0500 |
---|---|---|
committer | Gary Kramlich <grim@reaperworld.com> | 2022-08-22 22:05:55 -0500 |
commit | 87ae251b7d00e88604969ab6ad603ae8b79b2609 (patch) | |
tree | 299f615f65fb614d46fa3caefc602cff7a54c2e5 /libpurple/purplenotification.h | |
parent | fa017a235392d9b6e5270e918bb7725832c3c10f (diff) | |
download | pidgin-87ae251b7d00e88604969ab6ad603ae8b79b2609.tar.gz |
Create PurpleAuthorizationRequest and use it for notifications.
This replaces the old internal representation of authorization requests as well
as the UI's implementation of their own objects. Everything is now controlled
via PurpleAuthorizationRequest and the UI's display the notification for
interaction.
Testing Done:
Verified the notification and actions work in both finch and pidgin.
Reviewed at https://reviews.imfreedom.org/r/1613/
Diffstat (limited to 'libpurple/purplenotification.h')
-rw-r--r-- | libpurple/purplenotification.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/libpurple/purplenotification.h b/libpurple/purplenotification.h index 3ec0bdc6f1..0039c4ab33 100644 --- a/libpurple/purplenotification.h +++ b/libpurple/purplenotification.h @@ -27,6 +27,7 @@ #include <glib-object.h> #include "account.h" +#include "purpleauthorizationrequest.h" G_BEGIN_DECLS @@ -39,7 +40,7 @@ typedef enum { PURPLE_NOTIFICATION_TYPE_UNKNOWN, PURPLE_NOTIFICATION_TYPE_GENERIC, PURPLE_NOTIFICATION_TYPE_CONNECTION_ERROR, - PURPLE_NOTIFICATION_TYPE_CONTACT_AUTHORIZATION, + PURPLE_NOTIFICATION_TYPE_AUTHORIZATION_REQUEST, PURPLE_NOTIFICATION_TYPE_FILE_TRANSFER, PURPLE_NOTIFICATION_TYPE_CHAT_INVITE, PURPLE_NOTIFICATION_TYPE_MENTION, @@ -78,6 +79,21 @@ G_DECLARE_FINAL_TYPE(PurpleNotification, purple_notification, PURPLE, PurpleNotification *purple_notification_new(PurpleNotificationType type, PurpleAccount *account, gpointer data, GDestroyNotify data_destroy_func); /** + * purple_notification_new_from_authorization_request: + * @authorization_request: (transfer full): The [class@AuthorizationRequest] + * instance. + * + * Creates a new [class@PurpleNotification] for the @authorization_request. This + * helper will automatically fill out the notification according to the + * information in @authorization_request. + * + * Returns: (transfer full): The new notification. + * + * Since: 3.0.0 + */ +PurpleNotification *purple_notification_new_from_authorization_request(PurpleAuthorizationRequest *authorization_request); + +/** * purple_notification_get_id: * @notification: The instance. * @@ -260,6 +276,20 @@ gpointer purple_notification_get_data(PurpleNotification *notification); */ gint purple_notification_compare(gconstpointer a, gconstpointer b); +/** + * purple_notification_delete: + * @notification: The instance. + * + * Emits the [signal@PurpleNotification::deleted] signal. This is typically + * called by a user interface when the user has deleted a notification. + * + * If this is called more than once for @notification, the signal will not be + * emitted. + * + * Since: 3.0.0 + */ +void purple_notification_delete(PurpleNotification *notification); + G_END_DECLS #endif /* PURPLE_NOTIFICATION */ |