comparison libpurple/protocols/myspace/session.h @ 19432:210f792efd7c

In msimprpl, move zap-related code to a separate module.
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Sun, 26 Aug 2007 06:30:41 +0000
parents
children 9a1b28a10c95
comparison
equal deleted inserted replaced
19431:3b7539c7402e 19432:210f792efd7c
1 /* MySpaceIM Protocol Plugin, session
2 *
3 * Copyright (C) 2007, Jeff Connelly <jeff2@soc.pidgin.im>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20 /* Random number in every MsimSession, to ensure it is valid. */
21 #define MSIM_SESSION_STRUCT_MAGIC 0xe4a6752b
22
23 /* Everything needed to keep track of a session (proto_data field in PurpleConnection) */
24 typedef struct _MsimSession
25 {
26 guint magic; /**< MSIM_SESSION_STRUCT_MAGIC */
27 PurpleAccount *account;
28 PurpleConnection *gc;
29 guint sesskey; /**< Session key from server */
30 guint userid; /**< This user's numeric user ID */
31 gchar *username; /**< This user's unique username */
32 gint fd; /**< File descriptor to/from server */
33
34 /* TODO: Remove. */
35 GHashTable *user_lookup_cb; /**< Username -> userid lookup callback */
36 GHashTable *user_lookup_cb_data; /**< Username -> userid lookup callback data */
37
38 MsimMessage *server_info; /**< Parameters from server */
39
40 gchar *rxbuf; /**< Receive buffer */
41 guint rxoff; /**< Receive buffer offset */
42 guint next_rid; /**< Next request/response ID */
43 time_t last_comm; /**< Time received last communication */
44 guint inbox_status; /**< Bit field of inbox notifications */
45 } MsimSession;
46
47 /* Check if an MsimSession is valid */
48 #define MSIM_SESSION_VALID(s) (session != NULL && session->magic == MSIM_SESSION_STRUCT_MAGIC)
49
50