McdConnection

## McdConnection McdConnection — Connection class representing Telepathy connection class |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <mcd-connection.h>

                        McdConnection;
    McdConnection*      mcd_connection_new                  (DBusGConnection *dbus_connection,
                                                             const gchar *bus_name,
                                                             TpConnMgr *tp_conn_mgr,
                                                             McAccount *account,
                                                             McdPresenceFrame *presence_frame,
                                                             McdDispatcher *dispatcher);
    McAccount*          mcd_connection_get_account          (McdConnection *connection);
    TelepathyConnectionStatus mcd_connection_get_connection_status
                                                            (McdConnection *connection);
    gboolean            mcd_connection_request_channel      (McdConnection *connection,
                                                             const struct mcd_channel_request *req,
                                                             GError **error);
    gboolean            mcd_connection_cancel_channel_request
                                                            (McdConnection *connection,
                                                             guint operation_id,
                                                             const gchar *requestor_client_id,
                                                             GError **error);
    gboolean            mcd_connection_get_telepathy_details
                                                            (McdConnection *id,
                                                             gchar **ret_servname,
                                                             gchar **ret_objpath);
    gboolean            mcd_connection_remote_avatar_changed
                                                            (McdConnection *connection,
                                                             guint contact_id,
                                                             const gchar *token);
    void                mcd_connection_account_changed      (McdConnection *connection);
    void                mcd_connection_close                (McdConnection *connection);

## Description

FIXME

## Details

### McdConnection

    typedef struct {
        McdOperation parent;
    } McdConnection;

### mcd_connection_new ()

    McdConnection*      mcd_connection_new                  (DBusGConnection *dbus_connection,
                                                             const gchar *bus_name,
                                                             TpConnMgr *tp_conn_mgr,
                                                             McAccount *account,
                                                             McdPresenceFrame *presence_frame,
                                                             McdDispatcher *dispatcher);

`dbus_connection` : |
`bus_name` : |
`tp_conn_mgr` : |
`account` : |
`presence_frame` : |
`dispatcher` : |
Returns : |

### mcd_connection_get_account ()

    McAccount*          mcd_connection_get_account          (McdConnection *connection);

`connection` : |
Returns : |

### mcd_connection_get_connection_status ()

    TelepathyConnectionStatus mcd_connection_get_connection_status
                                                            (McdConnection *connection);

`connection` : |
Returns : |

### mcd_connection_request_channel ()

    gboolean            mcd_connection_request_channel      (McdConnection *connection,
                                                             const struct mcd_channel_request *req,
                                                             GError **error);

`connection` : |
`req` : |
`error` : |
Returns : |

### mcd_connection_cancel_channel_request ()

    gboolean            mcd_connection_cancel_channel_request
                                                            (McdConnection *connection,
                                                             guint operation_id,
                                                             const gchar *requestor_client_id,
                                                             GError **error);

`connection` : |
`operation_id` : |
`requestor_client_id` : |
`error` : |
Returns : |

### mcd_connection_get_telepathy_details ()

    gboolean            mcd_connection_get_telepathy_details
                                                            (McdConnection *id,
                                                             gchar **ret_servname,
                                                             gchar **ret_objpath);

`id` : |
`ret_servname` : |
`ret_objpath` : |
Returns : |

### mcd_connection_remote_avatar_changed ()

    gboolean            mcd_connection_remote_avatar_changed
                                                            (McdConnection *connection,
                                                             guint contact_id,
                                                             const gchar *token);

This function is to be called when Telepathy signals that our own avatar has been updated. It takes care of checking if the remote avatar has to be retrieved and stored in the account.

`connection` : | the McdConnection.
`contact_id` : | the own contact id in Telepathy.
`token` : | the new avatar token.
Returns : | `TRUE` if the local avatar has been updated.

### mcd_connection_account_changed ()

    void                mcd_connection_account_changed      (McdConnection *connection);

This function must be called when the account this connection refers to is modified. Note: ideally, this should be a private method and the connection should monitor the account itself; but since the monitoring is already done by McdMaster for all accounts, it seemed more convenient to let it call this function whenever needed.

`connection` : | the McdConnection.

### mcd_connection_close ()

    void                mcd_connection_close                (McdConnection *connection);

`connection` : |