Frameworks/libpurple.framework/Versions/0.6.0/Headers/session.h
changeset 2592 e8d15275025e
parent 2591 f66a716bfc79
child 2593 b4bd28402abc
     1.1 --- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/session.h	Fri Aug 21 13:24:36 2009 -0700
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,242 +0,0 @@
     1.4 -/**
     1.5 - * @file session.h MSN session functions
     1.6 - *
     1.7 - * purple
     1.8 - *
     1.9 - * Purple is the legal property of its developers, whose names are too numerous
    1.10 - * to list here.  Please refer to the COPYRIGHT file distributed with this
    1.11 - * source distribution.
    1.12 - *
    1.13 - * This program is free software; you can redistribute it and/or modify
    1.14 - * it under the terms of the GNU General Public License as published by
    1.15 - * the Free Software Foundation; either version 2 of the License, or
    1.16 - * (at your option) any later version.
    1.17 - *
    1.18 - * This program is distributed in the hope that it will be useful,
    1.19 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.20 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.21 - * GNU General Public License for more details.
    1.22 - *
    1.23 - * You should have received a copy of the GNU General Public License
    1.24 - * along with this program; if not, write to the Free Software
    1.25 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
    1.26 - */
    1.27 -#ifndef _MSN_SESSION_H_
    1.28 -#define _MSN_SESSION_H_
    1.29 -
    1.30 -typedef struct _MsnSession MsnSession;
    1.31 -
    1.32 -#include "sslconn.h"
    1.33 -
    1.34 -#include "user.h"
    1.35 -#include "slpcall.h"
    1.36 -
    1.37 -#include "notification.h"
    1.38 -#include "switchboard.h"
    1.39 -#include "group.h"
    1.40 -
    1.41 -#include "cmdproc.h"
    1.42 -#include "nexus.h"
    1.43 -#include "httpconn.h"
    1.44 -#include "oim.h"
    1.45 -
    1.46 -#include "userlist.h"
    1.47 -#include "sync.h"
    1.48 -
    1.49 -/**
    1.50 - * Types of errors.
    1.51 - */
    1.52 -typedef enum
    1.53 -{
    1.54 -	MSN_ERROR_SERVCONN,
    1.55 -	MSN_ERROR_UNSUPPORTED_PROTOCOL,
    1.56 -	MSN_ERROR_HTTP_MALFORMED,
    1.57 -	MSN_ERROR_AUTH,
    1.58 -	MSN_ERROR_BAD_BLIST,
    1.59 -	MSN_ERROR_SIGN_OTHER,
    1.60 -	MSN_ERROR_SERV_DOWN,
    1.61 -	MSN_ERROR_SERV_UNAVAILABLE
    1.62 -
    1.63 -} MsnErrorType;
    1.64 -
    1.65 -/**
    1.66 - * Login steps.
    1.67 - */
    1.68 -typedef enum
    1.69 -{
    1.70 -	MSN_LOGIN_STEP_START,
    1.71 -	MSN_LOGIN_STEP_HANDSHAKE,
    1.72 -	MSN_LOGIN_STEP_TRANSFER,
    1.73 -	MSN_LOGIN_STEP_HANDSHAKE2,
    1.74 -	MSN_LOGIN_STEP_AUTH_START,
    1.75 -	MSN_LOGIN_STEP_AUTH,
    1.76 -	MSN_LOGIN_STEP_GET_COOKIE,
    1.77 -	MSN_LOGIN_STEP_AUTH_END,
    1.78 -	MSN_LOGIN_STEP_SYN,
    1.79 -	MSN_LOGIN_STEP_END
    1.80 -
    1.81 -} MsnLoginStep;
    1.82 -
    1.83 -#define MSN_LOGIN_STEPS MSN_LOGIN_STEP_END
    1.84 -
    1.85 -struct _MsnSession
    1.86 -{
    1.87 -	PurpleAccount *account;
    1.88 -	MsnUser *user;
    1.89 -
    1.90 -	guint protocol_ver;
    1.91 -
    1.92 -	MsnLoginStep login_step; /**< The current step in the login process. */
    1.93 -
    1.94 -	gboolean connected;
    1.95 -	gboolean logged_in; /**< A temporal flag to ignore local buddy list adds. */
    1.96 -	int      adl_fqy; /**< A count of ADL/FQY so status is only changed once. */
    1.97 -	gboolean destroying; /**< A flag that states if the session is being destroyed. */
    1.98 -	gboolean http_method;
    1.99 -
   1.100 -	MsnNotification *notification;
   1.101 -	MsnNexus        *nexus;
   1.102 -	MsnOim          *oim;
   1.103 -	MsnSync         *sync;
   1.104 -	MsnUserList     *userlist;
   1.105 -	char            *abch_cachekey;
   1.106 -
   1.107 -	int servconns_count; /**< The count of server connections. */
   1.108 -	GList *switches; /**< The list of all the switchboards. */
   1.109 -	GList *slplinks; /**< The list of all the slplinks. */
   1.110 -
   1.111 -	/*psm info*/
   1.112 -	char *psm;
   1.113 -
   1.114 -#if 0
   1.115 -	char *blocked_text;
   1.116 -#endif
   1.117 -
   1.118 -	struct
   1.119 -	{
   1.120 -		char *kv;
   1.121 -		char *sid;
   1.122 -		char *mspauth;
   1.123 -		unsigned long sl;
   1.124 -		char *client_ip;
   1.125 -		int client_port;
   1.126 -		char *mail_url;
   1.127 -		gulong mail_timestamp;
   1.128 -		gboolean email_enabled;
   1.129 -	} passport_info;
   1.130 -
   1.131 -	GHashTable *soap_table;
   1.132 -	guint soap_cleanup_handle;
   1.133 -};
   1.134 -
   1.135 -/**
   1.136 - * Creates an MSN session.
   1.137 - *
   1.138 - * @param account The account.
   1.139 - *
   1.140 - * @return The new MSN session.
   1.141 - */
   1.142 -MsnSession *msn_session_new(PurpleAccount *account);
   1.143 -
   1.144 -/**
   1.145 - * Destroys an MSN session.
   1.146 - *
   1.147 - * @param session The MSN session to destroy.
   1.148 - */
   1.149 -void msn_session_destroy(MsnSession *session);
   1.150 -
   1.151 -/**
   1.152 - * Connects to and initiates an MSN session.
   1.153 - *
   1.154 - * @param session     The MSN session.
   1.155 - * @param host        The dispatch server host.
   1.156 - * @param port        The dispatch server port.
   1.157 - * @param http_method Whether to use or not http_method.
   1.158 - *
   1.159 - * @return @c TRUE on success, @c FALSE on failure.
   1.160 - */
   1.161 -gboolean msn_session_connect(MsnSession *session,
   1.162 -							 const char *host, int port,
   1.163 -							 gboolean http_method);
   1.164 -
   1.165 -/**
   1.166 - * Disconnects from an MSN session.
   1.167 - *
   1.168 - * @param session The MSN session.
   1.169 - */
   1.170 -void msn_session_disconnect(MsnSession *session);
   1.171 -
   1.172 - /**
   1.173 - * Finds a switchboard with the given username.
   1.174 - *
   1.175 - * @param session The MSN session.
   1.176 - * @param username The username to search for.
   1.177 - *
   1.178 - * @return The switchboard, if found.
   1.179 - */
   1.180 -MsnSwitchBoard *msn_session_find_swboard(MsnSession *session,
   1.181 -										 const char *username);
   1.182 -
   1.183 - /**
   1.184 - * Finds a switchboard with the given conversation.
   1.185 - *
   1.186 - * @param session The MSN session.
   1.187 - * @param conv    The conversation to search for.
   1.188 - *
   1.189 - * @return The switchboard, if found.
   1.190 - */
   1.191 -MsnSwitchBoard *msn_session_find_swboard_with_conv(MsnSession *session,
   1.192 -												   PurpleConversation *conv);
   1.193 -/**
   1.194 - * Finds a switchboard with the given chat ID.
   1.195 - *
   1.196 - * @param session The MSN session.
   1.197 - * @param chat_id The chat ID to search for.
   1.198 - *
   1.199 - * @return The switchboard, if found.
   1.200 - */
   1.201 -MsnSwitchBoard *msn_session_find_swboard_with_id(const MsnSession *session,
   1.202 -												 int chat_id);
   1.203 -
   1.204 -/**
   1.205 - * Returns a switchboard to communicate with certain username.
   1.206 - *
   1.207 - * @param session The MSN session.
   1.208 - * @param username The username to search for.
   1.209 - * @param flag The flag of the switchboard
   1.210 - *
   1.211 - * @return The switchboard.
   1.212 - */
   1.213 -MsnSwitchBoard *msn_session_get_swboard(MsnSession *session,
   1.214 -										const char *username, MsnSBFlag flag);
   1.215 -
   1.216 -/**
   1.217 - * Sets an error for the MSN session.
   1.218 - *
   1.219 - * @param session The MSN session.
   1.220 - * @param error The error.
   1.221 - * @param info Extra information.
   1.222 - */
   1.223 -void msn_session_set_error(MsnSession *session, MsnErrorType error,
   1.224 -						   const char *info);
   1.225 -
   1.226 -/**
   1.227 - * Sets the current step in the login proccess.
   1.228 - *
   1.229 - * @param session The MSN session.
   1.230 - * @param step The current step.
   1.231 - */
   1.232 -void msn_session_set_login_step(MsnSession *session, MsnLoginStep step);
   1.233 -
   1.234 -/**
   1.235 - * Finish the login proccess.
   1.236 - *
   1.237 - * @param session The MSN session.
   1.238 - */
   1.239 -void msn_session_finish_login(MsnSession *session);
   1.240 -
   1.241 -/*post message to User*/
   1.242 -void msn_session_report_user(MsnSession *session,const char *passport,
   1.243 -							const char *msg,PurpleMessageFlags flags);
   1.244 -
   1.245 -#endif /* _MSN_SESSION_H_ */