summaryrefslogtreecommitdiff
path: root/libpurple/account.h
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2022-12-12 00:47:54 -0600
committerGary Kramlich <grim@reaperworld.com>2022-12-12 00:47:54 -0600
commitaf68be4fa34d08b4146ffc8e4e7f9ebac693eb96 (patch)
tree15d231c4417d6cca48c319e38c1eec642d3641e7 /libpurple/account.h
parent67bbadace042845934bd214b313f0232b453d03b (diff)
downloadpidgin-af68be4fa34d08b4146ffc8e4e7f9ebac693eb96.tar.gz
Make PurpleAccount subclass PurpleContactInfo
This allows accounts to be treated as PurpleContactInfo without duplication. The existing api was left with deprecation flags so we can knock them out file by file. Buddy Icons will replaced once /r/2092/ is merged. Presence is a little goofy for now, because it still depends on PurpleAccountPresence which I want to remove in a simplification of the status api. I considered overriding the propert, but since `purple_contact_info_get_presence` returns its instance, this won't work. Testing Done: Ran the unit tests and connected the demo protocol and an XMPP account that had contacts in the list. Reviewed at https://reviews.imfreedom.org/r/2113/
Diffstat (limited to 'libpurple/account.h')
-rw-r--r--libpurple/account.h25
1 files changed, 7 insertions, 18 deletions
diff --git a/libpurple/account.h b/libpurple/account.h
index a82540a605..ba3a545175 100644
--- a/libpurple/account.h
+++ b/libpurple/account.h
@@ -39,7 +39,7 @@ typedef gboolean (*PurpleFilterAccountFunc)(PurpleAccount *account);
#include "connection.h"
#include "group.h"
#include "purpleconnectionerrorinfo.h"
-#include "purplecontact.h"
+#include "purplecontactinfo.h"
#include "purpleprotocol.h"
#include "purpleproxyinfo.h"
#include "status.h"
@@ -82,7 +82,8 @@ G_BEGIN_DECLS
*
* Returns: The #GType for the Account object.
*/
-G_DECLARE_FINAL_TYPE(PurpleAccount, purple_account, PURPLE, ACCOUNT, GObject)
+G_DECLARE_FINAL_TYPE(PurpleAccount, purple_account, PURPLE, ACCOUNT,
+ PurpleContactInfo)
/**
* purple_account_new:
@@ -105,6 +106,7 @@ PurpleAccount *purple_account_new(const char *username, const char *protocol_id)
*
* Since: 3.0.0
*/
+G_DEPRECATED_FOR(purple_contact_info_get_id)
const gchar *purple_account_get_id(PurpleAccount *account);
/**
@@ -188,6 +190,7 @@ void purple_account_request_change_user_info(PurpleAccount *account);
*
* Sets the account's username.
*/
+G_DEPRECATED_FOR(purple_contact_info_set_username)
void purple_account_set_username(PurpleAccount *account, const char *username);
/**
@@ -401,6 +404,7 @@ gboolean purple_account_is_disconnected(PurpleAccount *account);
*
* Returns: The username.
*/
+G_DEPRECATED_FOR(purple_contact_info_get_username)
const char *purple_account_get_username(PurpleAccount *account);
/**
@@ -487,6 +491,7 @@ PurpleConnection *purple_account_get_connection(PurpleAccount *account);
*
* Returns: The name to display.
*/
+G_DEPRECATED_FOR(purple_contact_info_get_name_for_display)
const gchar *purple_account_get_name_for_display(PurpleAccount *account);
/**
@@ -767,22 +772,6 @@ void purple_account_set_require_password(PurpleAccount *account, gboolean requir
gboolean purple_account_get_require_password(PurpleAccount *account);
/**
- * purple_account_get_contact:
- * @account: The instance.
- *
- * Gets the [class@Purple.Contact] for @account that represents the user of
- * @account.
- *
- * This can be used by protocol plugins to store additional information about
- * the account.
- *
- * Returns: (transfer none): The contact that represents @account.
- *
- * Since: 3.0.0
- */
-PurpleContact *purple_account_get_contact(PurpleAccount *account);
-
-/**
* purple_account_freeze_notify_settings:
* @account: The instance.
*