6 * Copyright (C) 2009 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 /* Helper macros to iterate over session list in a SIP account */
24 #define SIPE_SESSION_FOREACH { \
25 GSList *entry = sip->sessions; \
27 struct sip_session *session = entry->data; \
29 #define SIPE_SESSION_FOREACH_END }}
31 /** Correspond to multy-party conversation */
33 gchar
*with
; /* For IM sessions only (not multi-party) . A URI.*/
34 /** key is user (URI) */
36 /** Link to purple chat or IM */
37 PurpleConversation
*conv
;
38 GSList
*outgoing_message_queue
;
39 /** Key is <Call-ID><CSeq><METHOD><To> */
40 GHashTable
*unconfirmed_messages
;
43 * Miltiparty conversation related fields
45 gboolean is_multiparty
;
48 /** purple indexes chats by names */
50 /** Human readable chat name */
52 /** Call-Id identifying the conversation */
53 gchar
*callid
; /* For multiparty conversations */
54 /** Roster Manager URI */
55 gchar
*roster_manager
;
57 gboolean is_voting_in_progress
;
58 GSList
*pending_invite_queue
;
61 * Conference related fields
68 struct sip_dialog
*focus_dialog
;
69 /** Key is Message-Id */
70 GHashTable
*conf_unconfirmed_messages
;
74 * Add a new chat session
76 * @param sip (in) SIP account data. May be NULL
78 * @return pointer to new session
81 sipe_session_add_chat(struct sipe_account_data
*sip
);
84 * Find chat session by Call ID
86 * @param sip (in) SIP account data. May be NULL
87 * @param callid (in) Call ID. May be NULL
89 * @return pointer to session or NULL
92 sipe_session_find_chat_by_callid(struct sipe_account_data
*sip
,
96 * Find or add new chat session by Call ID
98 * @param sip (in) SIP account data
99 * @param callid (in) Call ID
101 * @return pointer to session
104 sipe_session_find_or_add_chat_by_callid(struct sipe_account_data
*sip
,
105 const gchar
*callid
);
108 * Find chat session by ID
110 * @param sip (in) SIP account data. May be NULL
111 * @param id (in) Chat ID
113 * @return pointer to session or NULL
116 sipe_session_find_chat_by_id(struct sipe_account_data
*sip
, int id
);
119 * Find chat session by name
121 * @param sip (in) SIP account data. May be NULL
122 * @param name (in) Chat name. May be NULL
124 * @return pointer to session or NULL
127 sipe_session_find_chat_by_title(struct sipe_account_data
*sip
,
131 * Find Conference session
133 * @param sip (in) SIP account data. May be NULL
134 * @param focus_uri (in) URI of conference focus. May be NULL
136 * @return pointer to session or NULL
139 sipe_session_find_conference(struct sipe_account_data
*sip
,
140 const gchar
*focus_uri
);
145 * @param sip (in) SIP account data. May be NULL
146 * @param who (in) remote partner. May be NULL
148 * @return pointer to session or NULL
151 sipe_session_find_im(struct sipe_account_data
*sip
, const gchar
*who
);
154 * Find or add new IM session
156 * @param sip (in) SIP account data
157 * @param who (in) remote partner
159 * @return pointer to session
162 sipe_session_find_or_add_im(struct sipe_account_data
*sip
,
166 * Remove a session from a SIP account
168 * @param sip (in) SIP account data
169 * @param session (in) pointer to session
172 sipe_session_remove(struct sipe_account_data
*sip
,
173 struct sip_session
*session
);
176 * Remove all sessions from a SIP account
178 * @param sip (in) SIP account data
181 sipe_session_remove_all(struct sipe_account_data
*sip
);