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