core cleanup: clean up sipe.h & core-depurple.h
[siplcs.git] / src / core / sipe.h
blob840d407351ba9d6346f225ad118617848fc10674
1 /**
2 * @file sipe.h
4 *****************************************************************************
5 *** !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ***
6 *** ***
7 *** THIS INTERFACE IS DEPECRATED ***
8 *** ***
9 *** DO NOT INCLUDE IT IN ANY NEW CODE ***
10 *** ***
11 *** !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ***
12 *****************************************************************************
14 * pidgin-sipe
16 * Copyright (C) 2010-11 SIPE Project <http://sipe.sourceforge.net/>
17 * Copyright (C) 2008 Novell, Inc.
18 * Copyright (C) 2007 Anibal Avelar <avelar@gmail.com>
19 * Copyright (C) 2005 Thomas Butter <butter@uni-mannheim.de>
21 * This program is free software; you can redistribute it and/or modify
22 * it under the terms of the GNU General Public License as published by
23 * the Free Software Foundation; either version 2 of the License, or
24 * (at your option) any later version.
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
31 * You should have received a copy of the GNU General Public License
32 * along with this program; if not, write to the Free Software
33 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
37 * Interface dependencies:
39 * <time.h>
40 * <glib.h>
43 /* Forward declarations */
44 struct sipmsg;
45 struct _PurpleAccount;
46 struct _PurpleConnection;
47 struct sipe_core_private;
48 struct transaction;
49 struct transaction_payload;
51 /** MS-PRES publication */
52 struct sipe_publication {
53 gchar *category;
54 guint instance;
55 guint container;
56 guint version;
57 /** for 'state' category */
58 int availability;
59 /** for 'state:calendarState' category */
60 char *cal_event_hash;
61 /** for 'note' category */
62 gchar *note;
63 /** for 'calendarData' category; 300(Team) container */
64 char *working_hours_xml_str;
65 char *fb_start_str;
66 char *free_busy_base64;
69 struct sipe_account_data {
70 struct _PurpleConnection *gc;
71 gchar *authdomain;
72 gchar *authuser;
73 gchar *password;
74 /** Allowed server events to subscribe. From register OK response. */
75 GSList *allow_events;
76 struct sip_csta *csta; /* For RCC - Remote Call Control */
77 gboolean subscribed_buddies; /* whether subscribed to buddies presence */
78 gboolean access_level_set; /* whether basic access level set */
79 gboolean initial_state_published; /* whether we published our initial state */
80 GSList *our_publication_keys; /* [MS-PRES] */
81 GHashTable *our_publications; /* [MS-PRES] */
82 GHashTable *user_state_publications; /* [MS-PRES] */
83 int contacts_delta;
84 int acl_delta;
85 int presence_method_version;
86 time_t do_not_publish[SIPE_ACTIVITY_NUM_TYPES];
87 gchar *status;
88 gboolean is_oof_note;
89 gchar *note;
90 time_t note_since;
91 time_t idle_switch;
92 gboolean batched_support; /*if there is support for batched subscription*/
93 GSList *containers; /* MS-PRES containers */
94 struct _PurpleAccount *account;
95 gchar *regcallid;
96 GSList *groups;
97 struct sipe_calendar *cal;
98 gchar *email;
99 /** 2005 Custom XML piece.
100 * Possibly set by other point of presence or just other client at earlier time.
101 * It should be preserved/modified, not overwritten. This implies subscription
102 * to self-contasct.
103 * This XML keeps OC2005:
104 * - User note
105 * - OOF flag
106 * - User status
108 gchar *user_states;
111 struct sipe_auth_job {
112 gchar *who;
113 struct sipe_core_private *sipe_private;
116 struct group_user_context {
117 gchar * group_name;
118 gchar * user_name;
121 GSList * slist_insert_unique_sorted(GSList *list, gpointer data, GCompareFunc func);
124 * Publishes self status
125 * based on own calendar information,
126 * our Calendar information - FreeBusy, WorkingHours,
127 * OOF note.
129 * For 2007+
131 void
132 publish_calendar_status_self(struct sipe_core_private *sipe_private,
133 void *unused);
136 * For 2005-
138 void
139 send_presence_soap(struct sipe_core_private *sipe_private,
140 gboolean do_publish_calendar);
143 * THE BIG SPLIT - temporary interfaces
145 * Previously private functions in sipe.c that are
146 * - waiting to be factored out to an appropriate module
147 * - are needed by the already created new modules
150 /* ??? module */
151 void sipe_connection_cleanup(struct sipe_core_private *sipe_private);
152 void sipe_buddy_free_all(struct sipe_core_private *sipe_private);
154 /* sipe-notify? */
155 void process_incoming_notify(struct sipe_core_private *sipe_private,
156 struct sipmsg *msg,
157 gboolean request,
158 gboolean benotify);
160 /* sipe-soap? */
161 void send_soap_request_with_cb(struct sipe_core_private *sipe_private,
162 gchar *from0,
163 gchar *body,
164 gboolean (*callbackb) (struct sipe_core_private *, struct sipmsg *,struct transaction *),
165 struct transaction_payload *payload);
167 void send_soap_request(struct sipe_core_private *sipe_private, gchar *body);
169 /*** THE BIG SPLIT END ***/
171 /* @TODO: move to function instead: sip_soap_ms_pres() */
172 #define sipe_soap(method, body) \
173 "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
174 "<SOAP-ENV:Body>" \
175 "<m:" method " xmlns:m=\"http://schemas.microsoft.com/winrtc/2002/11/sip\">" \
176 body \
177 "</m:" method ">" \
178 "</SOAP-ENV:Body>" \
179 "</SOAP-ENV:Envelope>"