Make pidgin use report_disconnect_reason rather than report_disconnect, and
check purple_connection_reason_is_fatal rather than wants_to_die. (NB. Since
none of the protocols use error_reason yet, purple_connection_reason_is_fatal
is always true for now...)
/**
* @file connection.h Connection API
* @ingroup core
*
* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
* @see @ref connection-signals
*/
#ifndef _PURPLE_CONNECTION_H_
#define _PURPLE_CONNECTION_H_
typedefstruct_PurpleConnectionPurpleConnection;
/**
* Flags to change behavior of the client for a given connection.
*/
typedefenum
{
PURPLE_CONNECTION_HTML=0x0001,/**< Connection sends/receives in 'HTML'. */
PURPLE_CONNECTION_NO_BGCOLOR=0x0002,/**< Connection does not send/receive
background colors. */
PURPLE_CONNECTION_AUTO_RESP=0x0004,/**< Send auto responses when away. */
PURPLE_CONNECTION_FORMATTING_WBFO=0x0008,/**< The text buffer must be formatted as a whole */
PURPLE_CONNECTION_NO_NEWLINES=0x0010,/**< No new lines are allowed in outgoing messages */
PURPLE_CONNECTION_NO_FONTSIZE=0x0020,/**< Connection does not send/receive font sizes */
PURPLE_CONNECTION_NO_URLDESC=0x0040,/**< Connection does not support descriptions with links */
PURPLE_CONNECTION_NO_IMAGES=0x0080,/**< Connection does not support sending of images */
}PurpleConnectionFlags;
typedefenum
{
PURPLE_DISCONNECTED=0,/**< Disconnected. */
PURPLE_CONNECTED,/**< Connected. */
PURPLE_CONNECTING/**< Connecting. */
}PurpleConnectionState;
/** Possible errors that can cause a connection to be closed. */
typedefenum
{
/** There was an error sending or receiving on the network socket. */
PURPLE_REASON_NETWORK_ERROR=0,
/** The username or password was invalid. */
PURPLE_REASON_AUTHENTICATION_FAILED,
/** There was an error negotiating SSL on this connection, or encryption
* was unavailable and an account option was set to require it.
*/
PURPLE_REASON_ENCRYPTION_ERROR,
/** Someone is already connected to the server using the name you are
* trying to connect with.
*/
PURPLE_REASON_NAME_IN_USE,
/** The server did not provide a SSL certificate. */
PURPLE_REASON_CERT_NOT_PROVIDED,
/** The server's SSL certificate could not be trusted. */
PURPLE_REASON_CERT_UNTRUSTED,
/** The server's SSL certificate has expired. */
PURPLE_REASON_CERT_EXPIRED,
/** The server's SSL certificate is not yet valid. */
PURPLE_REASON_CERT_NOT_ACTIVATED,
/** The server's SSL certificate did not match its hostname. */
PURPLE_REASON_CERT_HOSTNAME_MISMATCH,
/** The server's SSL certificate does not have the expected
* fingerprint.
*/
PURPLE_REASON_CERT_FINGERPRINT_MISMATCH,
/** The server's SSL certificate is self-signed. */
PURPLE_REASON_CERT_SELF_SIGNED,
/** There was some other error validating the server's SSL certificate.
*/
PURPLE_REASON_CERT_OTHER_ERROR,
/** Some other error occured which fits into none of the other
* categories.
*/
PURPLE_REASON_OTHER_ERROR,
/** The number of PurpleDisconnectReason elements; not a valid reason.
*/
PURPLE_NUM_REASONS
}PurpleDisconnectReason;
#include<time.h>
#include"account.h"
#include"plugin.h"
#include"status.h"
/** Connection UI operations. Used to notify the user of changes to
* connections, such as being disconnected, and to respond to the
* underlying network connection appearing and disappearing. UIs should
* call #purple_connections_set_ui_ops() with an instance of this struct.
*
* @see @ref ui-ops
*/
typedefstruct
{
/** When an account is connecting, this operation is called to notify
* the UI of what is happening, as well as which @a step out of @a
* step_count has been reached (which might be displayed as a progress
* bar).
* @see #purple_connection_update_progress
*/
void(*connect_progress)(PurpleConnection*gc,
constchar*text,
size_tstep,
size_tstep_count);
/** Called when a connection is established (just before the
* @ref signed-on signal).
*/
void(*connected)(PurpleConnection*gc);
/** Called when a connection is ended (between the @ref signing-off
* and @ref signed-off signals).
*/
void(*disconnected)(PurpleConnection*gc);
/** Used to display connection-specific notices. (Pidgin's Gtk user
* interface implements this as a no-op; #purple_connection_notice(),
* which uses this operation, is not used by any of the protocols