buddy: move pending_photo_requests to sipe_core_private
[siplcs.git] / src / core / sipe-core-private.h
blob23ac04562f1a5ad3665c1416eedec0dacda7b66d
1 /**
2 * @file sipe-core-private.h
4 * pidgin-sipe
6 * Copyright (C) 2010-11 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /* Forward declarations */
24 struct sip_csta;
25 struct sip_service_data;
26 struct sip_transport;
27 struct sipe_calendar;
28 struct sipe_certificate;
29 struct sipe_media_call_private;
30 struct sipe_groupchat;
31 struct sipe_svc;
33 /**
34 * Private part of the Sipe data structure
36 * This part contains the information only needed by the core
38 struct sipe_core_private {
39 /**
40 * The public part is the first item, i.e. a pointer to the
41 * public part can also be used as a pointer to the private part.
43 struct sipe_core_public public;
45 /* sip-transport.c private data */
46 struct sip_transport *transport;
47 const struct sip_service_data *service_data;
48 guint transport_type;
50 /* Account information */
51 gchar *username;
52 gchar *authdomain;
53 gchar *authuser;
54 gchar *password;
55 gchar *email;
57 /* SIPE protocol information */
58 gchar *contact;
59 gchar *register_callid;
60 gchar *epid;
61 gchar *focus_factory_uri;
62 GSList *sessions;
63 GSList *sessions_to_accept;
64 /* from REGISTER response: server events
65 * we're allowed to subscribe to
67 GSList *allowed_events;
69 /* Presence */
70 gchar *status;
71 gchar *note;
72 time_t note_since;
73 time_t idle_switch;
74 time_t do_not_publish[SIPE_ACTIVITY_NUM_TYPES];
76 /* [MS-SIP] deltaNum counters */
77 guint deltanum_contacts;
78 guint deltanum_acl; /* setACE (OCS2005 only) */
80 /* [MS-PRES] */
81 GSList *containers;
82 GSList *our_publication_keys;
83 GHashTable *our_publications;
84 GHashTable *user_state_publications;
86 /* Buddies */
87 GSList *groups;
88 GHashTable *buddies;
90 /* Calendar and related stuff */
91 struct sipe_calendar *calendar;
94 * 2005 Custom XML piece
96 * Possibly set by other point of presence or just other client at
97 * earlier time. It should be preserved/modified, not overwritten.
98 * This implies subscription to self-contact. Information kept:
100 * - User note
101 * - OOF flag
102 * - User status
104 gchar *ocs2005_user_states;
106 /* Scheduling system */
107 GSList *timeouts;
109 /* Active subscriptions */
110 GHashTable *subscriptions;
112 /* Voice call */
113 struct sipe_media_call_private *media_call;
114 gchar *test_call_bot_uri;
116 * Provides the necessary information on where we can obtain
117 * credentials for the A/V Edge server service.
119 gchar *mras_uri;
120 gchar *media_relay_username;
121 gchar *media_relay_password;
122 GSList *media_relays;
124 /* Group chat */
125 struct sipe_groupchat *groupchat;
127 /* buddy menu memory allocation */
128 GSList *blist_menu_containers;
130 /* For RCC - Remote Call Control */
131 struct sip_csta *csta;
133 struct sipe_dns_query *dns_query;
135 /* TLS-DSK: Certificates & Web services */
136 struct sipe_certificate *certificate;
137 struct sipe_svc *svc;
139 /* [MS-DLX] server URI */
140 gchar *dlx_uri;
142 /* Addressbook server URI */
143 gchar *addressbook_uri;
145 /* Pending photo download HTTP requests */
146 GSList *pending_photo_requests;
150 * Flags - stored in sipe_core_public.flags but names not exported
152 /* server is OCS2007+ */
153 #define SIPE_CORE_PRIVATE_FLAG_OCS2007 0x80000000
154 /* we are connected from outside the enterprise network boundary
155 * via Edge Server */
156 #define SIPE_CORE_PRIVATE_FLAG_REMOTE_USER 0x40000000
157 /* multiple points of presence detected */
158 #define SIPE_CORE_PRIVATE_FLAG_MPOP 0x20000000
159 /* if there is support for batched subscription*/
160 #define SIPE_CORE_PRIVATE_FLAG_BATCHED_SUPPORT 0x10000000
161 /* if note is out-of-office note */
162 #define SIPE_CORE_PRIVATE_FLAG_OOF_NOTE 0x08000000
163 /* whether we published our initial state or not */
164 #define SIPE_CORE_PRIVATE_FLAG_INITIAL_PUBLISH 0x04000000
165 /* whether basic access level is set or not */
166 #define SIPE_CORE_PRIVATE_FLAG_ACCESS_LEVEL_SET 0x02000000
167 /* whether subscribed to buddies presence or not */
168 #define SIPE_CORE_PRIVATE_FLAG_SUBSCRIBED_BUDDIES 0x01000000
170 #define SIPE_CORE_PUBLIC_FLAG_IS(flag) \
171 ((sipe_private->public.flags & SIPE_CORE_FLAG_ ## flag) == SIPE_CORE_FLAG_ ## flag)
172 #define SIPE_CORE_PUBLIC_FLAG_SET(flag) \
173 (sipe_private->public.flags |= SIPE_CORE_FLAG_ ## flag)
174 #define SIPE_CORE_PUBLIC_FLAG_UNSET(flag) \
175 (sipe_private->public.flags &= ~SIPE_CORE_FLAG_ ## flag)
176 #define SIPE_CORE_PRIVATE_FLAG_IS(flag) \
177 ((sipe_private->public.flags & SIPE_CORE_PRIVATE_FLAG_ ## flag) == SIPE_CORE_PRIVATE_FLAG_ ## flag)
178 #define SIPE_CORE_PRIVATE_FLAG_SET(flag) \
179 (sipe_private->public.flags |= SIPE_CORE_PRIVATE_FLAG_ ## flag)
180 #define SIPE_CORE_PRIVATE_FLAG_UNSET(flag) \
181 (sipe_private->public.flags &= ~SIPE_CORE_PRIVATE_FLAG_ ## flag)
183 /* Convenience macros */
184 #define SIPE_CORE_PRIVATE ((struct sipe_core_private *)sipe_public)
185 #define SIPE_CORE_PUBLIC ((struct sipe_core_public *)sipe_private)
188 * sipe-core internal functions
190 void sipe_core_connection_cleanup(struct sipe_core_private *sipe_private);
193 Local Variables:
194 mode: c
195 c-file-style: "bsd"
196 indent-tabs-mode: t
197 tab-width: 8
198 End: