Data Structures | Typedefs | Enumerations
account.h File Reference
libpurple

Account API. More...

`#include <glib.h>`
`#include <glib-object.h>`
`#include "connection.h"`
`#include "log.h"`
`#include "privacy.h"`
`#include "proxy.h"`
`#include "prpl.h"`
`#include "status.h"`

Go to the source code of this file.

## Data Structures
struct | _PurpleAccountUiOps
| Account UI operations, used to notify the user of status changes and when buddies add this account to their buddy lists. More...
struct | _PurpleAccountPrefsUiOps
| Account prefs UI operations, to allow the UI to catch account preference changes. More...
struct | _PurpleAccount
| Structure representing an account. More...

## Typedefs
typedef struct _PurpleAccountUiOps | PurpleAccountUiOps
| Account UI operations, used to notify the user of status changes and when buddies add this account to their buddy lists. More...
typedef struct _PurpleAccountPrefsUiOps | PurpleAccountPrefsUiOps
| Account prefs UI operations, to allow the UI to catch account preference changes. More...
typedef struct _PurpleAccount | PurpleAccount
| Structure representing an account. More...
typedef gboolean(* | PurpleFilterAccountFunc) (PurpleAccount *account)
typedef void(* | PurpleAccountRequestAuthorizationCb) (void *)
typedef void(* | PurpleAccountRegistrationCb) (PurpleAccount *account, gboolean succeeded, void *user_data)
typedef void(* | PurpleAccountUnregistrationCb) (PurpleAccount *account, gboolean succeeded, void *user_data)
typedef void(* | PurpleSetPublicAliasSuccessCallback) (PurpleAccount *account, const char *new_alias)
typedef void(* | PurpleSetPublicAliasFailureCallback) (PurpleAccount *account, const char *error)
typedef void(* | PurpleGetPublicAliasSuccessCallback) (PurpleAccount *account, const char *alias)
typedef void(* | PurpleGetPublicAliasFailureCallback) (PurpleAccount *account, const char *error)

## Enumerations
enum | PurpleAccountRequestType { PURPLE_ACCOUNT_REQUEST_AUTHORIZATION = 0 }
| Account request types.
enum | PurpleAccountRequestResponse { PURPLE_ACCOUNT_RESPONSE_IGNORE = -2, PURPLE_ACCOUNT_RESPONSE_DENY = -1, PURPLE_ACCOUNT_RESPONSE_PASS = 0, PURPLE_ACCOUNT_RESPONSE_ACCEPT = 1 }
| Account request response types.

## Functions
Account API
PurpleAccount * | purple_account_new (const char *username, const char *protocol_id)
| Creates a new account. More...
void | purple_account_destroy (PurpleAccount *account)
| Destroys an account. More...
void | purple_account_connect (PurpleAccount *account)
| Connects to an account. More...
void | purple_account_set_register_callback (PurpleAccount *account, PurpleAccountRegistrationCb cb, void *user_data)
| Sets the callback for successful registration. More...
void | purple_account_register (PurpleAccount *account)
| Registers an account. More...
void | purple_account_unregister (PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data)
| Unregisters an account (deleting it from the server). More...
void | purple_account_disconnect (PurpleAccount *account)
| Disconnects from an account. More...
void | purple_account_notify_added (PurpleAccount *account, const char *remote_user, const char *id, const char *alias, const char *message)
| Notifies the user that the account was added to a remote user's buddy list. More...
void | purple_account_request_add (PurpleAccount *account, const char *remote_user, const char *id, const char *alias, const char *message)
| Notifies the user that the account was addded to a remote user's buddy list and asks ther user if they want to add the remote user to their buddy list. More...
void * | purple_account_request_authorization (PurpleAccount *account, const char *remote_user, const char *id, const char *alias, const char *message, gboolean on_list, PurpleAccountRequestAuthorizationCb auth_cb, PurpleAccountRequestAuthorizationCb deny_cb, void *user_data)
| Notifies the user that a remote user has wants to add the local user to his or her buddy list and requires authorization to do so. More...
void | purple_account_request_close_with_account (PurpleAccount *account)
| Close account requests registered for the given PurpleAccount. More...
void | purple_account_request_close (void *ui_handle)
| Close the account request for the given ui handle. More...
void | purple_account_request_password (PurpleAccount *account, GCallback ok_cb, GCallback cancel_cb, void *user_data)
| Requests a password from the user for the account. More...
void | purple_account_request_change_password (PurpleAccount *account)
| Requests information from the user to change the account's password. More...
void | purple_account_request_change_user_info (PurpleAccount *account)
| Requests information from the user to change the account's user information. More...
void | purple_account_set_username (PurpleAccount *account, const char *username)
| Sets the account's username. More...
void | purple_account_set_password (PurpleAccount *account, const char *password)
| Sets the account's password. More...
void | purple_account_set_alias (PurpleAccount *account, const char *alias)
| Sets the account's alias. More...
void | purple_account_set_user_info (PurpleAccount *account, const char *user_info)
| Sets the account's user information. More...
void | purple_account_set_buddy_icon_path (PurpleAccount *account, const char *path)
| Sets the account's buddy icon path. More...
void | purple_account_set_protocol_id (PurpleAccount *account, const char *protocol_id)
| Sets the account's protocol ID. More...
void | purple_account_set_connection (PurpleAccount *account, PurpleConnection *gc)
| Sets the account's connection. More...
void | purple_account_set_remember_password (PurpleAccount *account, gboolean value)
| Sets whether or not this account should save its password. More...
void | purple_account_set_check_mail (PurpleAccount *account, gboolean value)
| Sets whether or not this account should check for mail. More...
void | purple_account_set_enabled (PurpleAccount *account, const char *ui, gboolean value)
| Sets whether or not this account is enabled for the specified UI. More...
void | purple_account_set_proxy_info (PurpleAccount *account, PurpleProxyInfo *info)
| Sets the account's proxy information. More...
void | purple_account_set_privacy_type (PurpleAccount *account, PurplePrivacyType privacy_type)
| Sets the account's privacy type. More...
void | purple_account_set_status_types (PurpleAccount *account, GList *status_types)
| Sets the account's status types. More...
void | purple_account_set_status (PurpleAccount *account, const char *status_id, gboolean active,...) G_GNUC_NULL_TERMINATED
| Variadic version of purple_account_set_status_list(); the variadic list replaces attrs, and should be `NULL`-terminated. More...
void | purple_account_set_status_list (PurpleAccount *account, const char *status_id, gboolean active, GList *attrs)
| Activates or deactivates a status. More...
void | purple_account_set_public_alias (PurpleAccount *account, const char *alias, PurpleSetPublicAliasSuccessCallback success_cb, PurpleSetPublicAliasFailureCallback failure_cb)
| Set a server-side (public) alias for this account. More...
void | purple_account_get_public_alias (PurpleAccount *account, PurpleGetPublicAliasSuccessCallback success_cb, PurpleGetPublicAliasFailureCallback failure_cb)
| Fetch the server-side (public) alias for this account. More...
gboolean | purple_account_get_silence_suppression (const PurpleAccount *account)
| Return whether silence suppression is used during voice call. More...
void | purple_account_set_silence_suppression (PurpleAccount *account, gboolean value)
| Sets whether silence suppression is used during voice call. More...
void | purple_account_clear_settings (PurpleAccount *account)
| Clears all protocol-specific settings on an account. More...
void | purple_account_remove_setting (PurpleAccount *account, const char *setting)
| Removes an account-specific setting by name. More...
void | purple_account_set_int (PurpleAccount *account, const char *name, int value)
| Sets a protocol-specific integer setting for an account. More...
void | purple_account_set_string (PurpleAccount *account, const char *name, const char *value)
| Sets a protocol-specific string setting for an account. More...
void | purple_account_set_bool (PurpleAccount *account, const char *name, gboolean value)
| Sets a protocol-specific boolean setting for an account. More...
void | purple_account_set_ui_int (PurpleAccount *account, const char *ui, const char *name, int value)
| Sets a UI-specific integer setting for an account. More...
void | purple_account_set_ui_string (PurpleAccount *account, const char *ui, const char *name, const char *value)
| Sets a UI-specific string setting for an account. More...
void | purple_account_set_ui_bool (PurpleAccount *account, const char *ui, const char *name, gboolean value)
| Sets a UI-specific boolean setting for an account. More...
gboolean | purple_account_is_connected (const PurpleAccount *account)
| Returns whether or not the account is connected. More...
gboolean | purple_account_is_connecting (const PurpleAccount *account)
| Returns whether or not the account is connecting. More...
gboolean | purple_account_is_disconnected (const PurpleAccount *account)
| Returns whether or not the account is disconnected. More...
const char * | purple_account_get_username (const PurpleAccount *account)
| Returns the account's username. More...
const char * | purple_account_get_password (const PurpleAccount *account)
| Returns the account's password. More...
const char * | purple_account_get_alias (const PurpleAccount *account)
| Returns the account's alias. More...
const char * | purple_account_get_user_info (const PurpleAccount *account)
| Returns the account's user information. More...
const char * | purple_account_get_buddy_icon_path (const PurpleAccount *account)
| Gets the account's buddy icon path. More...
const char * | purple_account_get_protocol_id (const PurpleAccount *account)
| Returns the account's protocol ID. More...
const char * | purple_account_get_protocol_name (const PurpleAccount *account)
| Returns the account's protocol name. More...
PurpleConnection * | purple_account_get_connection (const PurpleAccount *account)
| Returns the account's connection. More...
const gchar * | purple_account_get_name_for_display (const PurpleAccount *account)
| Returns a name for this account appropriate for display to the user. More...
gboolean | purple_account_get_remember_password (const PurpleAccount *account)
| Returns whether or not this account should save its password. More...
gboolean | purple_account_get_check_mail (const PurpleAccount *account)
| Returns whether or not this account should check for mail. More...
gboolean | purple_account_get_enabled (const PurpleAccount *account, const char *ui)
| Returns whether or not this account is enabled for the specified UI. More...
PurpleProxyInfo * | purple_account_get_proxy_info (const PurpleAccount *account)
| Returns the account's proxy information. More...
PurplePrivacyType | purple_account_get_privacy_type (const PurpleAccount *account)
| Returns the account's privacy type. More...
PurpleStatus * | purple_account_get_active_status (const PurpleAccount *account)
| Returns the active status for this account. More...
PurpleStatus * | purple_account_get_status (const PurpleAccount *account, const char *status_id)
| Returns the account status with the specified ID. More...
PurpleStatusType * | purple_account_get_status_type (const PurpleAccount *account, const char *id)
| Returns the account status type with the specified ID. More...
PurpleStatusType * | purple_account_get_status_type_with_primitive (const PurpleAccount *account, PurpleStatusPrimitive primitive)
| Returns the account status type with the specified primitive. More...
PurplePresence * | purple_account_get_presence (const PurpleAccount *account)
| Returns the account's presence. More...
gboolean | purple_account_is_status_active (const PurpleAccount *account, const char *status_id)
| Returns whether or not an account status is active. More...
GList * | purple_account_get_status_types (const PurpleAccount *account)
| Returns the account's status types. More...
int | purple_account_get_int (const PurpleAccount *account, const char *name, int default_value)
| Returns a protocol-specific integer setting for an account. More...
const char * | purple_account_get_string (const PurpleAccount *account, const char *name, const char *default_value)
| Returns a protocol-specific string setting for an account. More...
gboolean | purple_account_get_bool (const PurpleAccount *account, const char *name, gboolean default_value)
| Returns a protocol-specific boolean setting for an account. More...
int | purple_account_get_ui_int (const PurpleAccount *account, const char *ui, const char *name, int default_value)
| Returns a UI-specific integer setting for an account. More...
const char * | purple_account_get_ui_string (const PurpleAccount *account, const char *ui, const char *name, const char *default_value)
| Returns a UI-specific string setting for an account. More...
gboolean | purple_account_get_ui_bool (const PurpleAccount *account, const char *ui, const char *name, gboolean default_value)
| Returns a UI-specific boolean setting for an account. More...
PurpleLog * | purple_account_get_log (PurpleAccount *account, gboolean create)
| Returns the system log for an account. More...
void | purple_account_destroy_log (PurpleAccount *account)
| Frees the system log of an account. More...
void | purple_account_add_buddy (PurpleAccount *account, PurpleBuddy *buddy)
| Adds a buddy to the server-side buddy list for the specified account. More...
void | purple_account_add_buddy_with_invite (PurpleAccount *account, PurpleBuddy *buddy, const char *message)
| Adds a buddy to the server-side buddy list for the specified account. More...
void | purple_account_add_buddies (PurpleAccount *account, GList *buddies)
| Adds a list of buddies to the server-side buddy list. More...
void | purple_account_add_buddies_with_invite (PurpleAccount *account, GList *buddies, const char *message)
| Adds a list of buddies to the server-side buddy list. More...
void | purple_account_remove_buddy (PurpleAccount *account, PurpleBuddy *buddy, PurpleGroup *group)
| Removes a buddy from the server-side buddy list. More...
void | purple_account_remove_buddies (PurpleAccount *account, GList *buddies, GList *groups)
| Removes a list of buddies from the server-side buddy list. More...
void | purple_account_remove_group (PurpleAccount *account, PurpleGroup *group)
| Removes a group from the server-side buddy list. More...
void | purple_account_change_password (PurpleAccount *account, const char *orig_pw, const char *new_pw)
| Changes the password on the specified account. More...
gboolean | purple_account_supports_offline_message (PurpleAccount *account, PurpleBuddy *buddy)
| Whether the account supports sending offline messages to buddy. More...
const PurpleConnectionErrorInfo * | purple_account_get_current_error (PurpleAccount *account)
| Get the error that caused the account to be disconnected, or `NULL` if the account is happily connected or disconnected without an error. More...
void | purple_account_clear_current_error (PurpleAccount *account)
| Clear an account's current error state, resetting it to `NULL`. More...
Accounts API
void | purple_accounts_add (PurpleAccount *account)
| Adds an account to the list of accounts. More...
void | purple_accounts_remove (PurpleAccount *account)
| Removes an account from the list of accounts. More...
void | purple_accounts_delete (PurpleAccount *account)
| Deletes an account. More...
void | purple_accounts_reorder (PurpleAccount *account, gint new_index)
| Reorders an account. More...
GList * | purple_accounts_get_all (void)
| Returns a list of all accounts. More...
GList * | purple_accounts_get_all_active (void)
| Returns a list of all enabled accounts. More...
PurpleAccount * | purple_accounts_find (const char *name, const char *protocol)
| Finds an account with the specified name and protocol id. More...
void | purple_accounts_restore_current_statuses (void)
| This is called by the core after all subsystems and what not have been initialized. More...
UI Registration Functions
void | purple_accounts_set_ui_ops (PurpleAccountUiOps *ops)
| Sets the UI operations structure to be used for accounts. More...
PurpleAccountUiOps * | purple_accounts_get_ui_ops (void)
| Returns the UI operations structure used for accounts. More...
void | purple_account_prefs_set_ui_ops (PurpleAccountPrefsUiOps *ops)
| Sets the UI operations structure to be used for account preferences. More...
PurpleAccountPrefsUiOps * | purple_account_prefs_get_ui_ops (void)
| Returns the UI operations structure used for account preferences. More...
Accounts Subsystem
void * | purple_accounts_get_handle (void)
| Returns the accounts subsystem handle. More...
void | purple_accounts_init (void)
| Initializes the accounts subsystem.
void | purple_accounts_uninit (void)
| Uninitializes the accounts subsystem.

## Detailed Description

Account API.

See also
  Account Signals

Definition in file account.h.

## Typedef Documentation

## ◆ PurpleAccount

typedef struct _PurpleAccount PurpleAccount

Structure representing an account.

Definition at line 38 of file account.h.

## ◆ PurpleAccountPrefsUiOps

typedef struct _PurpleAccountPrefsUiOps PurpleAccountPrefsUiOps

Account prefs UI operations, to allow the UI to catch account preference changes.

Unlike the PurplePrefsUiOps API, these are always stored internally in a hash table. If the UI wants to handle accounts settings, it must set them to the account on load and handle changes with set_ methods. Implementing load/save/schedule_save disables the built-in accounts.xml code.

Since
  2.11.0

Definition at line 36 of file account.h.

## ◆ PurpleAccountUiOps

typedef struct _PurpleAccountUiOps PurpleAccountUiOps

Account UI operations, used to notify the user of status changes and when buddies add this account to their buddy lists.

Definition at line 34 of file account.h.

## Function Documentation

## ◆ purple_account_add_buddies()

void purple_account_add_buddies | ( | PurpleAccount * | account,
|  | GList * | buddies
| ) |  |

Adds a list of buddies to the server-side buddy list.

Parameters

  account | The account.
  buddies | The list of PurpleBlistNodes representing the buddies to add.

Deprecated:
  Use purple_account_add_buddies_with_invite and `NULL` message.

## ◆ purple_account_add_buddies_with_invite()

void purple_account_add_buddies_with_invite | ( | PurpleAccount * | account,
|  | GList * | buddies,
|  | const char * | message
| ) |  |

Adds a list of buddies to the server-side buddy list.

Parameters

  account | The account.
  buddies | The list of PurpleBlistNodes representing the buddies to add.
  message | The invite message. This may be ignored by a prpl.

Since
  2.8.0

## ◆ purple_account_add_buddy()

void purple_account_add_buddy | ( | PurpleAccount * | account,
|  | PurpleBuddy * | buddy
| ) |  |

Adds a buddy to the server-side buddy list for the specified account.

Parameters

  account | The account.
  buddy | The buddy to add.

Deprecated:
  Use purple_account_add_buddy_with_invite and `NULL` message.

## ◆ purple_account_add_buddy_with_invite()

void purple_account_add_buddy_with_invite | ( | PurpleAccount * | account,
|  | PurpleBuddy * | buddy,
|  | const char * | message
| ) |  |

Adds a buddy to the server-side buddy list for the specified account.

Parameters

  account | The account.
  buddy | The buddy to add.
  message | The invite message. This may be ignored by a prpl.

Since
  2.8.0

## ◆ purple_account_change_password()

void purple_account_change_password | ( | PurpleAccount * | account,
|  | const char * | orig_pw,
|  | const char * | new_pw
| ) |  |

Changes the password on the specified account.

Parameters

  account | The account.
  orig_pw | The old password.
  new_pw | The new password.

## ◆ purple_account_clear_current_error()

void purple_account_clear_current_error | ( | PurpleAccount * | account | ) |

Clear an account's current error state, resetting it to `NULL`.

Parameters

  account | The account whose error state should be cleared.

## ◆ purple_account_clear_settings()

void purple_account_clear_settings | ( | PurpleAccount * | account | ) |

Clears all protocol-specific settings on an account.

Parameters

  account | The account.

## ◆ purple_account_connect()

void purple_account_connect | ( | PurpleAccount * | account | ) |

Connects to an account.

Parameters

  account | The account to connect to.

## ◆ purple_account_destroy()

void purple_account_destroy | ( | PurpleAccount * | account | ) |

Destroys an account.

Parameters

  account | The account to destroy.

## ◆ purple_account_destroy_log()

void purple_account_destroy_log | ( | PurpleAccount * | account | ) |

Frees the system log of an account.

Parameters

  account | The account.

## ◆ purple_account_disconnect()

void purple_account_disconnect | ( | PurpleAccount * | account | ) |

Disconnects from an account.

Parameters

  account | The account to disconnect from.

## ◆ purple_account_get_active_status()

PurpleStatus* purple_account_get_active_status | ( | const PurpleAccount * | account | ) |

Returns the active status for this account.

This looks through the PurplePresence associated with this account and returns the PurpleStatus that has its active flag set to "TRUE." There can be only one active PurpleStatus in a PurplePresence.

Parameters

  account | The account.

Returns
  The active status.

## ◆ purple_account_get_alias()

const char* purple_account_get_alias | ( | const PurpleAccount * | account | ) |

Returns the account's alias.

Parameters

  account | The account.

Returns
  The alias.

## ◆ purple_account_get_bool()

gboolean purple_account_get_bool | ( | const PurpleAccount * | account,
|  | const char * | name,
|  | gboolean | default_value
| ) |  |

Returns a protocol-specific boolean setting for an account.

Parameters

  account | The account.
  name | The name of the setting.
  default_value | The default value.

Returns
  The value.

## ◆ purple_account_get_buddy_icon_path()

const char* purple_account_get_buddy_icon_path | ( | const PurpleAccount * | account | ) |

Gets the account's buddy icon path.

Parameters

  account | The account.

Returns
  The buddy icon's non-cached path.

## ◆ purple_account_get_check_mail()

gboolean purple_account_get_check_mail | ( | const PurpleAccount * | account | ) |

Returns whether or not this account should check for mail.

Parameters

  account | The account.

Returns
  `TRUE` if it should check for mail.

## ◆ purple_account_get_connection()

PurpleConnection* purple_account_get_connection | ( | const PurpleAccount * | account | ) |

Returns the account's connection.

Parameters

  account | The account.

Returns
  The connection.

## ◆ purple_account_get_current_error()

const PurpleConnectionErrorInfo* purple_account_get_current_error | ( | PurpleAccount * | account | ) |

Get the error that caused the account to be disconnected, or `NULL` if the account is happily connected or disconnected without an error.

Parameters

  account | The account whose error should be retrieved.

Note
  The return value of this function must not be modified or freed.

Returns
  The type of error and a human-readable description of the current error, or `NULL` if there is no current error. This pointer is guaranteed to remain valid until the account-error-changed signal is emitted for account.

## ◆ purple_account_get_enabled()

gboolean purple_account_get_enabled | ( | const PurpleAccount * | account,
|  | const char * | ui
| ) |  |

Returns whether or not this account is enabled for the specified UI.

Parameters

  account | The account.
  ui | The UI.

Returns
  `TRUE` if it enabled on this UI.

## ◆ purple_account_get_int()

int purple_account_get_int | ( | const PurpleAccount * | account,
|  | const char * | name,
|  | int | default_value
| ) |  |

Returns a protocol-specific integer setting for an account.

Parameters

  account | The account.
  name | The name of the setting.
  default_value | The default value.

Returns
  The value.

## ◆ purple_account_get_log()

PurpleLog* purple_account_get_log | ( | PurpleAccount * | account,
|  | gboolean | create
| ) |  |

Returns the system log for an account.

Parameters

  account | The account.
  create | Should it be created if it doesn't exist?

Returns
  The log.

Note
  Callers should almost always pass `FALSE` for create. Passing `TRUE` could result in an existing log being reopened, if the log has already been closed, which not all loggers deal with appropriately.

## ◆ purple_account_get_name_for_display()

const gchar* purple_account_get_name_for_display | ( | const PurpleAccount * | account | ) |

Returns a name for this account appropriate for display to the user.

In order of preference: the account's alias; the contact or buddy alias (if the account exists on its own buddy list); the connection's display name; the account's username.

Parameters

  account | The account.

Returns
  The name to display.

Since
  2.7.0

## ◆ purple_account_get_password()

const char* purple_account_get_password | ( | const PurpleAccount * | account | ) |

Returns the account's password.

Parameters

  account | The account.

Returns
  The password.

## ◆ purple_account_get_presence()

PurplePresence* purple_account_get_presence | ( | const PurpleAccount * | account | ) |

Returns the account's presence.

Parameters

  account | The account.

Returns
  The account's presence.

## ◆ purple_account_get_privacy_type()

PurplePrivacyType purple_account_get_privacy_type | ( | const PurpleAccount * | account | ) |

Returns the account's privacy type.

Parameters

  account | The account.

Returns
  The privacy type.

Since
  2.7.0

## ◆ purple_account_get_protocol_id()

const char* purple_account_get_protocol_id | ( | const PurpleAccount * | account | ) |

Returns the account's protocol ID.

Parameters

  account | The account.

Returns
  The protocol ID.

## ◆ purple_account_get_protocol_name()

const char* purple_account_get_protocol_name | ( | const PurpleAccount * | account | ) |

Returns the account's protocol name.

Parameters

  account | The account.

Returns
  The protocol name.

## ◆ purple_account_get_proxy_info()

PurpleProxyInfo* purple_account_get_proxy_info | ( | const PurpleAccount * | account | ) |

Returns the account's proxy information.

Parameters

  account | The account.

Returns
  The proxy information.

## ◆ purple_account_get_public_alias()

void purple_account_get_public_alias | ( | PurpleAccount * | account,
|  | PurpleGetPublicAliasSuccessCallback | success_cb,
|  | PurpleGetPublicAliasFailureCallback | failure_cb
| ) |  |

Fetch the server-side (public) alias for this account.

The account must already be connected.

Parameters

  account | The account
  success_cb | A callback which will be called with the alias
  failure_cb | A callback which will be called if the prpl is unable to retrieve the server-side alias.

Since
  2.7.0

## ◆ purple_account_get_remember_password()

gboolean purple_account_get_remember_password | ( | const PurpleAccount * | account | ) |

Returns whether or not this account should save its password.

Parameters

  account | The account.

Returns
  `TRUE` if it should remember the password.

## ◆ purple_account_get_silence_suppression()

gboolean purple_account_get_silence_suppression | ( | const PurpleAccount * | account | ) |

Return whether silence suppression is used during voice call.

Parameters

  account | The account.

Returns
  `TRUE` if suppression is used, or `FALSE` if not.

## ◆ purple_account_get_status()

PurpleStatus* purple_account_get_status | ( | const PurpleAccount * | account,
|  | const char * | status_id
| ) |  |

Returns the account status with the specified ID.

Note that this works differently than purple_buddy_get_status() in that it will only return NULL if the status was not registered.

Parameters

  account | The account.
  status_id | The status ID.

Returns
  The status, or NULL if it was never registered.

## ◆ purple_account_get_status_type()

PurpleStatusType* purple_account_get_status_type | ( | const PurpleAccount * | account,
|  | const char * | id
| ) |  |

Returns the account status type with the specified ID.

Parameters

  account | The account.
  id | The ID of the status type to find.

Returns
  The status type if found, or NULL.

## ◆ purple_account_get_status_type_with_primitive()

PurpleStatusType* purple_account_get_status_type_with_primitive | ( | const PurpleAccount * | account,
|  | PurpleStatusPrimitive | primitive
| ) |  |

Returns the account status type with the specified primitive.

Note: It is possible for an account to have more than one PurpleStatusType with the same primitive. In this case, the first PurpleStatusType is returned.

Parameters

  account | The account.
  primitive | The type of the status type to find.

Returns
  The status if found, or NULL.

## ◆ purple_account_get_status_types()

GList* purple_account_get_status_types | ( | const PurpleAccount * | account | ) |

Returns the account's status types.

Parameters

  account | The account.

Note
  The return value of this function must not be modified or freed.

Returns
  The account's status types.

## ◆ purple_account_get_string()

const char* purple_account_get_string | ( | const PurpleAccount * | account,
|  | const char * | name,
|  | const char * | default_value
| ) |  |

Returns a protocol-specific string setting for an account.

Parameters

  account | The account.
  name | The name of the setting.
  default_value | The default value.

Returns
  The value.

## ◆ purple_account_get_ui_bool()

gboolean purple_account_get_ui_bool | ( | const PurpleAccount * | account,
|  | const char * | ui,
|  | const char * | name,
|  | gboolean | default_value
| ) |  |

Returns a UI-specific boolean setting for an account.

Parameters

  account | The account.
  ui | The UI name.
  name | The name of the setting.
  default_value | The default value.

Returns
  The value.

## ◆ purple_account_get_ui_int()

int purple_account_get_ui_int | ( | const PurpleAccount * | account,
|  | const char * | ui,
|  | const char * | name,
|  | int | default_value
| ) |  |

Returns a UI-specific integer setting for an account.

Parameters

  account | The account.
  ui | The UI name.
  name | The name of the setting.
  default_value | The default value.

Returns
  The value.

## ◆ purple_account_get_ui_string()

const char* purple_account_get_ui_string | ( | const PurpleAccount * | account,
|  | const char * | ui,
|  | const char * | name,
|  | const char * | default_value
| ) |  |

Returns a UI-specific string setting for an account.

Parameters

  account | The account.
  ui | The UI name.
  name | The name of the setting.
  default_value | The default value.

Returns
  The value.

## ◆ purple_account_get_user_info()

const char* purple_account_get_user_info | ( | const PurpleAccount * | account | ) |

Returns the account's user information.

Parameters

  account | The account.

Returns
  The user information.

## ◆ purple_account_get_username()

const char* purple_account_get_username | ( | const PurpleAccount * | account | ) |

Returns the account's username.

Parameters

  account | The account.

Returns
  The username.

## ◆ purple_account_is_connected()

gboolean purple_account_is_connected | ( | const PurpleAccount * | account | ) |

Returns whether or not the account is connected.

Parameters

  account | The account.

Returns
  `TRUE` if connected, or `FALSE` otherwise.

## ◆ purple_account_is_connecting()

gboolean purple_account_is_connecting | ( | const PurpleAccount * | account | ) |

Returns whether or not the account is connecting.

Parameters

  account | The account.

Returns
  `TRUE` if connecting, or `FALSE` otherwise.

## ◆ purple_account_is_disconnected()

gboolean purple_account_is_disconnected | ( | const PurpleAccount * | account | ) |

Returns whether or not the account is disconnected.

Parameters

  account | The account.

Returns
  `TRUE` if disconnected, or `FALSE` otherwise.

## ◆ purple_account_is_status_active()

gboolean purple_account_is_status_active | ( | const PurpleAccount * | account,
|  | const char * | status_id
| ) |  |

Returns whether or not an account status is active.

Parameters

  account | The account.
  status_id | The status ID.

Returns
  TRUE if active, or FALSE if not.

## ◆ purple_account_new()

PurpleAccount* purple_account_new | ( | const char * | username,
|  | const char * | protocol_id
| ) |  |

Creates a new account.

Parameters

  username | The username.
  protocol_id | The protocol ID.

Returns
  The new account.

## ◆ purple_account_notify_added()

void purple_account_notify_added | ( | PurpleAccount * | account,
|  | const char * | remote_user,
|  | const char * | id,
|  | const char * | alias,
|  | const char * | message
| ) |  |

Notifies the user that the account was added to a remote user's buddy list.

This will present a dialog informing the user that he was added to the remote user's buddy list.

Parameters

  account | The account that was added.
  remote_user | The name of the user that added this account.
  id | The optional ID of the local account. Rarely used.
  alias | The optional alias of the user.
  message | The optional message sent from the user adding you.

## ◆ purple_account_prefs_get_ui_ops()

PurpleAccountPrefsUiOps* purple_account_prefs_get_ui_ops | ( | void |  | ) |

Returns the UI operations structure used for account preferences.

Returns
  The UI operations structure in use.

Since
  2.11.0

## ◆ purple_account_prefs_set_ui_ops()

void purple_account_prefs_set_ui_ops | ( | PurpleAccountPrefsUiOps * | ops | ) |

Sets the UI operations structure to be used for account preferences.

Parameters

  ops | The UI operations structure.

Since
  2.11.0

## ◆ purple_account_register()

void purple_account_register | ( | PurpleAccount * | account | ) |

Registers an account.

Parameters

  account | The account to register.

## ◆ purple_account_remove_buddies()

void purple_account_remove_buddies | ( | PurpleAccount * | account,
|  | GList * | buddies,
|  | GList * | groups
| ) |  |

Removes a list of buddies from the server-side buddy list.

Note
  The lists buddies and groups are parallel lists. Be sure that node n of groups matches node n of buddies.

Parameters

  account | The account.
  buddies | The list of buddies to remove.
  groups | The list of groups to remove buddies from. Each node of this list should match the corresponding node of buddies.

## ◆ purple_account_remove_buddy()

void purple_account_remove_buddy | ( | PurpleAccount * | account,
|  | PurpleBuddy * | buddy,
|  | PurpleGroup * | group
| ) |  |

Removes a buddy from the server-side buddy list.

Parameters

  account | The account.
  buddy | The buddy to remove.
  group | The group to remove the buddy from.

## ◆ purple_account_remove_group()

void purple_account_remove_group | ( | PurpleAccount * | account,
|  | PurpleGroup * | group
| ) |  |

Removes a group from the server-side buddy list.

Parameters

  account | The account.
  group | The group to remove.

## ◆ purple_account_remove_setting()

void purple_account_remove_setting | ( | PurpleAccount * | account,
|  | const char * | setting
| ) |  |

Removes an account-specific setting by name.

Parameters

  account | The account.
  setting | The setting to remove.

Since
  2.6.0

## ◆ purple_account_request_add()

void purple_account_request_add | ( | PurpleAccount * | account,
|  | const char * | remote_user,
|  | const char * | id,
|  | const char * | alias,
|  | const char * | message
| ) |  |

Notifies the user that the account was addded to a remote user's buddy list and asks ther user if they want to add the remote user to their buddy list.

This will present a dialog informing the local user that the remote user added them to the remote user's buddy list and will ask if they want to add the remote user to the buddy list.

Parameters

  account | The account that was added.
  remote_user | The name of the user that added this account.
  id | The optional ID of the local account. Rarely used.
  alias | The optional alias of the user.
  message | The optional message sent from the user adding you.

## ◆ purple_account_request_authorization()

void* purple_account_request_authorization | ( | PurpleAccount * | account,
|  | const char * | remote_user,
|  | const char * | id,
|  | const char * | alias,
|  | const char * | message,
|  | gboolean | on_list,
|  | PurpleAccountRequestAuthorizationCb | auth_cb,
|  | PurpleAccountRequestAuthorizationCb | deny_cb,
|  | void * | user_data
| ) |  |

Notifies the user that a remote user has wants to add the local user to his or her buddy list and requires authorization to do so.

This will present a dialog informing the user of this and ask if the user authorizes or denies the remote user from adding him.

Parameters

  account | The account that was added
  remote_user | The name of the user that added this account.
  id | The optional ID of the local account. Rarely used.
  alias | The optional alias of the remote user.
  message | The optional message sent by the user wanting to add you.
  on_list | Is the remote user already on the buddy list?
  auth_cb | The callback called when the local user accepts
  deny_cb | The callback called when the local user rejects
  user_data | Data to be passed back to the above callbacks

Returns
  A UI-specific handle.

## ◆ purple_account_request_change_password()

void purple_account_request_change_password | ( | PurpleAccount * | account | ) |

Requests information from the user to change the account's password.

Parameters

  account | The account to change the password on.

## ◆ purple_account_request_change_user_info()

void purple_account_request_change_user_info | ( | PurpleAccount * | account | ) |

Requests information from the user to change the account's user information.

Parameters

  account | The account to change the user information on.

## ◆ purple_account_request_close()

void purple_account_request_close | ( | void * | ui_handle | ) |

Close the account request for the given ui handle.

Parameters

  ui_handle | The ui specific handle for which requests should be closed

## ◆ purple_account_request_close_with_account()

void purple_account_request_close_with_account | ( | PurpleAccount * | account | ) |

Close account requests registered for the given PurpleAccount.

Parameters

  account | The account for which requests should be closed

## ◆ purple_account_request_password()

void purple_account_request_password | ( | PurpleAccount * | account,
|  | GCallback | ok_cb,
|  | GCallback | cancel_cb,
|  | void * | user_data
| ) |  |

Requests a password from the user for the account.

Does not set the account password on success; do that in ok_cb if desired.

Parameters

  account | The account to request the password for.
  ok_cb | The callback for the OK button.
  cancel_cb | The callback for the cancel button.
  user_data | User data to be passed into callbacks.

## ◆ purple_account_set_alias()

void purple_account_set_alias | ( | PurpleAccount * | account,
|  | const char * | alias
| ) |  |

Sets the account's alias.

Parameters

  account | The account.
  alias | The alias.

## ◆ purple_account_set_bool()

void purple_account_set_bool | ( | PurpleAccount * | account,
|  | const char * | name,
|  | gboolean | value
| ) |  |

Sets a protocol-specific boolean setting for an account.

Parameters

  account | The account.
  name | The name of the setting.
  value | The setting's value.

## ◆ purple_account_set_buddy_icon_path()

void purple_account_set_buddy_icon_path | ( | PurpleAccount * | account,
|  | const char * | path
| ) |  |

Sets the account's buddy icon path.

Parameters

  account | The account.
  path | The buddy icon non-cached path.

## ◆ purple_account_set_check_mail()

void purple_account_set_check_mail | ( | PurpleAccount * | account,
|  | gboolean | value
| ) |  |

Sets whether or not this account should check for mail.

Parameters

  account | The account.
  value | `TRUE` if it should check for mail.

## ◆ purple_account_set_connection()

void purple_account_set_connection | ( | PurpleAccount * | account,
|  | PurpleConnection * | gc
| ) |  |

Sets the account's connection.

Parameters

  account | The account.
  gc | The connection.

## ◆ purple_account_set_enabled()

void purple_account_set_enabled | ( | PurpleAccount * | account,
|  | const char * | ui,
|  | gboolean | value
| ) |  |

Sets whether or not this account is enabled for the specified UI.

Parameters

  account | The account.
  ui | The UI.
  value | `TRUE` if it is enabled.

## ◆ purple_account_set_int()

void purple_account_set_int | ( | PurpleAccount * | account,
|  | const char * | name,
|  | int | value
| ) |  |

Sets a protocol-specific integer setting for an account.

Parameters

  account | The account.
  name | The name of the setting.
  value | The setting's value.

## ◆ purple_account_set_password()

void purple_account_set_password | ( | PurpleAccount * | account,
|  | const char * | password
| ) |  |

Sets the account's password.

Parameters

  account | The account.
  password | The password.

## ◆ purple_account_set_privacy_type()

void purple_account_set_privacy_type | ( | PurpleAccount * | account,
|  | PurplePrivacyType | privacy_type
| ) |  |

Sets the account's privacy type.

Parameters

  account | The account.
  privacy_type | The privacy type.

Since
  2.7.0

## ◆ purple_account_set_protocol_id()

void purple_account_set_protocol_id | ( | PurpleAccount * | account,
|  | const char * | protocol_id
| ) |  |

Sets the account's protocol ID.

Parameters

  account | The account.
  protocol_id | The protocol ID.

## ◆ purple_account_set_proxy_info()

void purple_account_set_proxy_info | ( | PurpleAccount * | account,
|  | PurpleProxyInfo * | info
| ) |  |

Sets the account's proxy information.

Parameters

  account | The account.
  info | The proxy information.

## ◆ purple_account_set_public_alias()

void purple_account_set_public_alias | ( | PurpleAccount * | account,
|  | const char * | alias,
|  | PurpleSetPublicAliasSuccessCallback | success_cb,
|  | PurpleSetPublicAliasFailureCallback | failure_cb
| ) |  |

Set a server-side (public) alias for this account.

The account must already be connected.

Currently, the public alias is not stored locally, although this may change in a later version.

Parameters

  account | The account
  alias | The new public alias for this account or NULL to unset the alias/nickname (or return it to a protocol-specific "default", like the username)
  success_cb | A callback which will be called if the alias is successfully set on the server (or NULL).
  failure_cb | A callback which will be called if the alias is not successfully set on the server (or NULL).

Since
  2.7.0

## ◆ purple_account_set_register_callback()

void purple_account_set_register_callback | ( | PurpleAccount * | account,
|  | PurpleAccountRegistrationCb | cb,
|  | void * | user_data
| ) |  |

Sets the callback for successful registration.

Parameters

  account | The account for which this callback should be used
  cb | The callback
  user_data | The user data passed to the callback

## ◆ purple_account_set_remember_password()

void purple_account_set_remember_password | ( | PurpleAccount * | account,
|  | gboolean | value
| ) |  |

Sets whether or not this account should save its password.

Parameters

  account | The account.
  value | `TRUE` if it should remember the password.

## ◆ purple_account_set_silence_suppression()

void purple_account_set_silence_suppression | ( | PurpleAccount * | account,
|  | gboolean | value
| ) |  |

Sets whether silence suppression is used during voice call.

Parameters

  account | The account.
  value | `TRUE` if suppression should be used.

## ◆ purple_account_set_status()

void purple_account_set_status | ( | PurpleAccount * | account,
|  | const char * | status_id,
|  | gboolean | active,
|  |  | ...
| ) |  |

Variadic version of purple_account_set_status_list(); the variadic list replaces attrs, and should be `NULL`-terminated.

Activates or deactivates a status. All changes to the statuses of an account go through this function or purple_account_set_status().

You can only deactivate an exclusive status by activating another exclusive status. So, if status_id is an exclusive status and active is `FALSE`, this function does nothing.

Parameters

  account | The account.
  status_id | The ID of the status.
  active | Whether status_id is to be activated (`TRUE`) or deactivated (`FALSE`).
  attrs | A list of `const char *` attribute names followed by `const char *` attribute values for the status. (For example, one pair might be `"message"` followed by `"hello, talk to me!"`.)

## ◆ purple_account_set_status_list()

void purple_account_set_status_list | ( | PurpleAccount * | account,
|  | const char * | status_id,
|  | gboolean | active,
|  | GList * | attrs
| ) |  |

Activates or deactivates a status.

All changes to the statuses of an account go through this function or purple_account_set_status().

You can only deactivate an exclusive status by activating another exclusive status. So, if status_id is an exclusive status and active is `FALSE`, this function does nothing.

Parameters

  account | The account.
  status_id | The ID of the status.
  active | Whether status_id is to be activated (`TRUE`) or deactivated (`FALSE`).
  attrs | A list of `const char *` attribute names followed by `const char *` attribute values for the status. (For example, one pair might be `"message"` followed by `"hello, talk to me!"`.)

## ◆ purple_account_set_status_types()

void purple_account_set_status_types | ( | PurpleAccount * | account,
|  | GList * | status_types
| ) |  |

Sets the account's status types.

Parameters

  account | The account.
  status_types | The list of status types.

## ◆ purple_account_set_string()

void purple_account_set_string | ( | PurpleAccount * | account,
|  | const char * | name,
|  | const char * | value
| ) |  |

Sets a protocol-specific string setting for an account.

Parameters

  account | The account.
  name | The name of the setting.
  value | The setting's value.

## ◆ purple_account_set_ui_bool()

void purple_account_set_ui_bool | ( | PurpleAccount * | account,
|  | const char * | ui,
|  | const char * | name,
|  | gboolean | value
| ) |  |

Sets a UI-specific boolean setting for an account.

Parameters

  account | The account.
  ui | The UI name.
  name | The name of the setting.
  value | The setting's value.

## ◆ purple_account_set_ui_int()

void purple_account_set_ui_int | ( | PurpleAccount * | account,
|  | const char * | ui,
|  | const char * | name,
|  | int | value
| ) |  |

Sets a UI-specific integer setting for an account.

Parameters

  account | The account.
  ui | The UI name.
  name | The name of the setting.
  value | The setting's value.

## ◆ purple_account_set_ui_string()

void purple_account_set_ui_string | ( | PurpleAccount * | account,
|  | const char * | ui,
|  | const char * | name,
|  | const char * | value
| ) |  |

Sets a UI-specific string setting for an account.

Parameters

  account | The account.
  ui | The UI name.
  name | The name of the setting.
  value | The setting's value.

## ◆ purple_account_set_user_info()

void purple_account_set_user_info | ( | PurpleAccount * | account,
|  | const char * | user_info
| ) |  |

Sets the account's user information.

Parameters

  account | The account.
  user_info | The user information.

## ◆ purple_account_set_username()

void purple_account_set_username | ( | PurpleAccount * | account,
|  | const char * | username
| ) |  |

Sets the account's username.

Parameters

  account | The account.
  username | The username.

## ◆ purple_account_supports_offline_message()

gboolean purple_account_supports_offline_message | ( | PurpleAccount * | account,
|  | PurpleBuddy * | buddy
| ) |  |

Whether the account supports sending offline messages to buddy.

Parameters

  account | The account
  buddy | The buddy

## ◆ purple_account_unregister()

void purple_account_unregister | ( | PurpleAccount * | account,
|  | PurpleAccountUnregistrationCb | cb,
|  | void * | user_data
| ) |  |

Unregisters an account (deleting it from the server).

Parameters

  account | The account to unregister.
  cb | Optional callback to be called when unregistration is complete
  user_data | user data to pass to the callback

## ◆ purple_accounts_add()

void purple_accounts_add | ( | PurpleAccount * | account | ) |

Adds an account to the list of accounts.

Parameters

  account | The account.

## ◆ purple_accounts_delete()

void purple_accounts_delete | ( | PurpleAccount * | account | ) |

Deletes an account.

This will remove any buddies from the buddy list that belong to this account, buddy pounces that belong to this account, and will also destroy account.

Parameters

  account | The account.

## ◆ purple_accounts_find()

PurpleAccount* purple_accounts_find | ( | const char * | name,
|  | const char * | protocol
| ) |  |

Finds an account with the specified name and protocol id.

Parameters

  name | The account username.
  protocol | The account protocol ID.

Returns
  The account, if found, or `FALSE` otherwise.

## ◆ purple_accounts_get_all()

GList* purple_accounts_get_all | ( | void |  | ) |

Returns a list of all accounts.

Note
  The return value of this function must not be modified or freed.

Returns
  A list of all accounts.

## ◆ purple_accounts_get_all_active()

GList* purple_accounts_get_all_active | ( | void |  | ) |

Returns a list of all enabled accounts.

Returns
  A list of all enabled accounts. The list is owned by the caller, and must be g_list_free()d to avoid leaking the nodes.

## ◆ purple_accounts_get_handle()

void* purple_accounts_get_handle | ( | void |  | ) |

Returns the accounts subsystem handle.

Returns
  The accounts subsystem handle.

## ◆ purple_accounts_get_ui_ops()

PurpleAccountUiOps* purple_accounts_get_ui_ops | ( | void |  | ) |

Returns the UI operations structure used for accounts.

Returns
  The UI operations structure in use.

## ◆ purple_accounts_remove()

void purple_accounts_remove | ( | PurpleAccount * | account | ) |

Removes an account from the list of accounts.

Parameters

  account | The account.

## ◆ purple_accounts_reorder()

void purple_accounts_reorder | ( | PurpleAccount * | account,
|  | gint | new_index
| ) |  |

Reorders an account.

Parameters

  account | The account to reorder.
  new_index | The new index for the account.

## ◆ purple_accounts_restore_current_statuses()

void purple_accounts_restore_current_statuses | ( | void |  | ) |

This is called by the core after all subsystems and what not have been initialized.

It sets all enabled accounts to their startup status by signing them on, setting them away, etc.

You probably shouldn't call this unless you really know what you're doing.

## ◆ purple_accounts_set_ui_ops()

void purple_accounts_set_ui_ops | ( | PurpleAccountUiOps * | ops | ) |

Sets the UI operations structure to be used for accounts.

Parameters

  ops | The UI operations structure.