pidgin/pidgin

Move Pidgin to the presence API

2 weeks ago, Gary Kramlich
3e480ee2d7ee
Parents a82453779416
Children b684cdd6dec7
Move Pidgin to the presence API

I think this is everything, but I'm not certain at the moment, but that's no
reason not to review request this!

Testing Done:
Checked in with the turtles and toggled a demo account a few times.

Reviewed at https://reviews.imfreedom.org/r/3097/
--- a/pidgin/pidginaccounteditor.c Fri Apr 12 00:53:01 2024 -0500
+++ b/pidgin/pidginaccounteditor.c Fri Apr 12 00:54:56 2024 -0500
@@ -1331,22 +1331,14 @@
pidgin_account_editor_save_advanced_options(editor);
pidgin_account_editor_save_proxy(editor, new_account);
- /* If this is a new account, add it to the account manager and bring it
- * online.
+ /* If this is a new account, enable it, and add it to the account manager.
*/
if(new_account) {
PurpleAccountManager *manager = NULL;
- const PurpleSavedStatus *saved_status;
+
+ purple_account_set_enabled(editor->account, TRUE);
manager = purple_account_manager_get_default();
-
purple_account_manager_add(manager, editor->account);
-
- saved_status = purple_savedstatus_get_current();
- if(saved_status != NULL) {
- purple_savedstatus_activate_for_account(saved_status,
- editor->account);
- purple_account_set_enabled(editor->account, TRUE);
- }
}
}
--- a/pidgin/pidginaccountmanagerrow.c Fri Apr 12 00:53:01 2024 -0500
+++ b/pidgin/pidginaccountmanagerrow.c Fri Apr 12 00:54:56 2024 -0500
@@ -160,16 +160,6 @@
PidginAccountManagerRow *row = data;
PurpleAccount *account = row->account;
- if(purple_account_get_enabled(account) == state) {
- return;
- }
-
- /* The account was just enabled, so set its status. */
- if(state) {
- PurpleSavedStatus *status = purple_savedstatus_get_current();
- purple_savedstatus_activate_for_account(status, account);
- }
-
purple_account_set_enabled(account, state);
}
--- a/pidgin/pidginiconname.c Fri Apr 12 00:53:01 2024 -0500
+++ b/pidgin/pidginiconname.c Fri Apr 12 00:54:56 2024 -0500
@@ -25,66 +25,6 @@
/******************************************************************************
* Public API
*****************************************************************************/
-const gchar *
-pidgin_icon_name_from_status_primitive(PurpleStatusPrimitive primitive,
- const gchar *fallback)
-{
- switch(primitive) {
- case PURPLE_STATUS_OFFLINE:
- return "pidgin-user-offline";
- break;
- case PURPLE_STATUS_AVAILABLE:
- return "pidgin-user-available";
- break;
- case PURPLE_STATUS_AWAY:
- return "pidgin-user-away";
- break;
- case PURPLE_STATUS_INVISIBLE:
- return "pidgin-user-invisible";
- break;
- case PURPLE_STATUS_UNAVAILABLE:
- case PURPLE_STATUS_EXTENDED_AWAY:
- return "pidgin-user-do-not-disturb";
- break;
- case PURPLE_STATUS_MOBILE:
- case PURPLE_STATUS_UNSET:
- default:
- break;
- }
-
- return fallback;
-}
-
-const gchar *
-pidgin_icon_name_from_status_type(PurpleStatusType *type, const gchar *fallback)
-{
- PurpleStatusPrimitive primitive;
-
- if(type == NULL) {
- return fallback;
- }
-
- primitive = purple_status_type_get_primitive(type);
-
- return pidgin_icon_name_from_status_primitive(primitive, fallback);
-}
-
-const gchar *
-pidgin_icon_name_from_status(PurpleStatus *status, const gchar *fallback) {
- PurpleStatusType *type = NULL;
-
- if(!PURPLE_IS_STATUS(status)) {
- return fallback;
- }
-
- type = purple_status_get_status_type(status);
- if(type == NULL) {
- return fallback;
- }
-
- return pidgin_icon_name_from_status_type(type, fallback);
-}
-
const char *
pidgin_icon_name_from_presence_primitive(PurplePresencePrimitive primitive,
const char *fallback)
--- a/pidgin/pidginiconname.h Fri Apr 12 00:53:01 2024 -0500
+++ b/pidgin/pidginiconname.h Fri Apr 12 00:54:56 2024 -0500
@@ -36,49 +36,6 @@
G_BEGIN_DECLS
/**
- * pidgin_icon_name_from_status_primitive:
- * @primitive: The #PurpleStatusPrimitive.
- * @fallback: The icon name to return if an icon name can not be found.
- *
- * Gets the icon name to use for @primitive if found, otherwise returns
- * @fallback.
- *
- * Returns: The icon name to use for @primitive.
- *
- * Since: 3.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-const gchar *pidgin_icon_name_from_status_primitive(PurpleStatusPrimitive primitive, const gchar *fallback);
-
-/**
- * pidgin_icon_name_from_status_type:
- * @type: The #PurpleStatusType.
- * @fallback: The icon name to return if an icon name can not be found.
- *
- * Gets the icon name to use for @type if found, otherwise returns @fallback.
- *
- * Returns: The icon name to use for @type.
- *
- * Since: 3.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-const gchar *pidgin_icon_name_from_status_type(PurpleStatusType *type, const gchar *fallback);
-
-/**
- * pidgin_icon_name_from_status:
- * @status: The #PurpleStatus instance.
- * @fallback: The icon name to return if an icon name can not be found.
- *
- * Gets the icon name to use for @status if found, otherwise returns @fallback.
- *
- * Returns: The icon name to use for @status.
- *
- * Since: 3.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-const gchar *pidgin_icon_name_from_status(PurpleStatus *status, const gchar *fallback);
-
-/**
* pidgin_icon_name_from_presence_primitive:
* @primitive: The [enum@Purple.PresencePrimitive].
* @fallback: The icon name to fall back to.