AccountsAdd

From TrillWiki

Jump to: navigation, search

The accountsAdd function lets a medium plugin add an account to the Connection Manager.

Compatibility: 2.0 and higher

Contents

Syntax

plugin_send(MYGUID, "accountsAdd", struct account_entry_t *);

Note that all Trillian functions and notifications begin with a lower-case letter, despite the Wiki requirement that all pages start with a capital letter.

Parameters

AccountsAdd utilitizes the account_entry_t structure.

struct account_entry_t
{
    unsigned int                struct_size;

    char                        *account;
    char                        *medium;
    char                        *status;
    char                        *section;

    int                         connected;
    long                        last_connected;

    HICON                       icon;
    HWND                        window;

    /* 3.0
     */
    ttkCallback                 callback;
    void                        *data;
};


account
The account name.
medium
The medium for the account.
status
The status for the particular account.
section
The contact list for the account. The default contact list is NULL.
connected
If the account is connected, set this to 1.
last_connected
The time when the account was last connected. If it is currently connected, then it is the time the connection started. This time is the number of seconds since the POSIX epoch (as returned by the C function time()).
icon
The icon to use with the account. See remarks below.
callback
(3.0) This is a required parameter in 3.0 and later. See remarks below.


Return Value

Negative value on error, 0 on success.

Remarks

It is the responsibility of the plugin to save the accounts to disk.

In 3.0 and later, plugins MUST register a callback when adding an account. This callback will receive the account interface notifications for the advanced connection manager used in 3.0 and beyond.


In 3.0, the icon field seems to have no effect. Icons must be added via skinning.

Personal tools