Tue, 27 Aug 2013 04:30:39 +0530
Merged soc.2013.gobjectification branch
|
20153
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* MySpaceIM Protocol Plugin, session |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
2 | * |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
3 | * Copyright (C) 2007, Jeff Connelly <jeff2@soc.pidgin.im> |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | * |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | * This program is free software; you can redistribute it and/or modify |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
7 | * the Free Software Foundation; either version 2 of the License, or |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
8 | * (at your option) any later version. |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
9 | * |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
13 | * GNU General Public License for more details. |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
14 | * |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
16 | * along with this program; if not, write to the Free Software |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
18 | */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
19 | |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
20 | #ifndef _MYSPACE_SESSION_H |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
21 | #define _MYSPACE_SESSION_H |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
22 | |
|
25190
87a8aba43d70
Shuffling things around, remove stray whitespace, remove some forward
Mark Doliner <markdoliner@pidgin.im>
parents:
24672
diff
changeset
|
23 | #include "account.h" |
|
87a8aba43d70
Shuffling things around, remove stray whitespace, remove some forward
Mark Doliner <markdoliner@pidgin.im>
parents:
24672
diff
changeset
|
24 | |
|
20153
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
25 | /* Random number in every MsimSession, to ensure it is valid. */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
26 | #define MSIM_SESSION_STRUCT_MAGIC 0xe4a6752b |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
27 | |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
28 | /* Everything needed to keep track of a session (proto_data field in PurpleConnection) */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
29 | typedef struct _MsimSession |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
30 | { |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
31 | guint magic; /**< MSIM_SESSION_STRUCT_MAGIC */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
32 | PurpleAccount *account; |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
33 | PurpleConnection *gc; |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
34 | guint sesskey; /**< Session key from server */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
35 | guint userid; /**< This user's numeric user ID */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
36 | gchar *username; /**< This user's unique username */ |
|
25212
9b3b9168c9e1
Grab the "Who can contact me? Only people on my buddy list?" and the
Mark Doliner <markdoliner@pidgin.im>
parents:
25197
diff
changeset
|
37 | gboolean show_only_to_list; |
|
25302
c29df5c659cf
This is a bitmask, and the "c" value here should be the least significant
Mark Doliner <markdoliner@pidgin.im>
parents:
25212
diff
changeset
|
38 | int privacy_mode; /**< This is a bitmask */ |
|
25212
9b3b9168c9e1
Grab the "Who can contact me? Only people on my buddy list?" and the
Mark Doliner <markdoliner@pidgin.im>
parents:
25197
diff
changeset
|
39 | int offline_message_mode; |
|
20153
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
40 | gint fd; /**< File descriptor to/from server */ |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29299
diff
changeset
|
41 | guint inpa; /**< The input watcher */ |
|
20153
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
42 | |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
43 | /* TODO: Remove. */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
44 | GHashTable *user_lookup_cb; /**< Username -> userid lookup callback */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
45 | GHashTable *user_lookup_cb_data; /**< Username -> userid lookup callback data */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
46 | |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
47 | MsimMessage *server_info; /**< Parameters from server */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
48 | |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
49 | gchar *rxbuf; /**< Receive buffer */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
50 | guint rxoff; /**< Receive buffer offset */ |
|
22348
4b0b743ba8c5
In msimprpl, grow the read buffer if it gets full using g_realloc(), similar to
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
21730
diff
changeset
|
51 | guint rxsize; /**< Receive buffer size */ |
|
20153
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
52 | guint next_rid; /**< Next request/response ID */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
53 | time_t last_comm; /**< Time received last communication */ |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
54 | guint inbox_status; /**< Bit field of inbox notifications */ |
|
21730
bc1897ec9281
applied changes from 6546cfd72ecd9aa76fc524aaf3ac48489aeb2a90
Kevin Stange <kstange@pidgin.im>
parents:
20376
diff
changeset
|
55 | guint inbox_handle; /**< The handle for the mail check timer */ |
|
20153
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
56 | } MsimSession; |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
57 | |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
58 | MsimSession *msim_session_new(PurpleAccount *acct); |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
59 | void msim_session_destroy(MsimSession *session); |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
60 | |
|
7cdc9e4882df
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
61 | #endif /* !_MYSPACE_SESSION_H */ |