MediumAdd

From TrillWiki

Jump to: navigation, search

The mediumAdd function adds a medium into Trillian. Once added, the callback provided will receive events that other chatting services within Trillian receive.

Compatibility: 2.0 and higher

Contents

Syntax

plugin_send(MYGUID, "mediumAdd", struct medium_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

MediumAdd utilitizes the medium_entry_t structure.

struct medium_entry_t
{
    unsigned int                struct_size;

    char                        *medium;
    char                        *description;

    int                         allows_accounts;
    int                         allows_connections;
    int                         allows_contacts;
    int                         allows_contact_importing; 
    int                         allows_message_sending;
    int                         allows_message_receiving;
    int                         allows_file_sending;
    int                         allows_file_receiving;
    int                         allows_massmessaging;

    ttkCallback                 callback;
    
    void                        *data;

    /* 3.0
     */
    int                         allows_account_editing;
    int                         allows_account_removing;
    int                         allows_contact_adding;

    unsigned char               *png_image_32;
    unsigned int                png_image_32_len;
    
    unsigned char               *png_image_16;
    unsigned int                png_image_16_len;
};



medium
The text representation for the medium.
description
A short text description for the medium.
allows_accounts
The medium has the notion of an account. This means options for it will be shown in the connection manager.
allows_connections
The medium has the notion of a connection. If it is something that does not have this, always use 0 when a connection_id is needed.
allows_contacts
Contacts for the medium can be added within the contact list. It will appear in the add contact wizard.
allows_contact_importing
If the medium wants to have a screen in the add contact wizard under the 'importing' area, set this to 1.
allows_message_sending
If the medium supports message sending over it, set this to 1.
allows_message_receiving
If the medium supports message receiving on it, set this to 1.
allows_file_sending
Files may be sent over the medium.
allows_file_receiving
Files may be received over the medium.
allows_massmessaging
The medium supports mass messaging. Mass messaging will not open up a unique window before giving a medium_messageSend. So if your medium does not support message sending without a window open, this should be set to 0.


Return Value

Negative value on error, 0 on success.

Remarks

Be sure to remove the medium when the plugin stops using mediumRemove.


Personal tools