webticket: implement caching
[siplcs.git] / src / core / sipe-im.h
blob1b4ac2a826ebda09978379000389440c54edc3eb
1 /**
2 * @file sipe-im.h
4 * pidgin-sipe
6 * Copyright (C) 2011 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_dialog;
25 struct sip_session;
26 struct sipe_core_private;
28 #ifdef HAVE_GMIME
29 /* pls. don't add multipart/related - it's not used in IM modality */
30 #define SDP_ACCEPT_TYPES "text/plain text/html image/gif multipart/alternative application/im-iscomposing+xml application/ms-imdn+xml text/x-msmsgsinvite"
31 #else
32 /* this is a rediculous hack as Pidgin's MIME implementastion doesn't support (or have bug) in multipart/alternative */
33 /* OCS/OC won't use multipart/related so we don't advertase it */
34 #define SDP_ACCEPT_TYPES "text/plain text/html image/gif application/im-iscomposing+xml application/ms-imdn+xml text/x-msmsgsinvite"
35 #endif
37 /**
38 * Send invitation and initial message to IM session
40 * @param sipe_private SIPE core private data
41 * @param session session for the IM conversation(s)
42 * @param who URI of the invitee
43 * @param msg_body message body or NULL
44 * @param content_type message body MIME type
45 * @param referred_by value for Referred-By or NULL
46 * @param is_triggered triggered invite or not
48 void sipe_im_invite(struct sipe_core_private *sipe_private,
49 struct sip_session *session,
50 const gchar *who,
51 const gchar *msg_body,
52 const gchar *content_type,
53 const gchar *referred_by,
54 const gboolean is_triggered);
56 /**
57 * Process queue IM messages
59 * @param sipe_private SIPE core private data
60 * @param session session for the IM conversation(s)
62 void sipe_im_process_queue(struct sipe_core_private *sipe_private,
63 struct sip_session *session);
65 /**
66 * Cancel unconfirmed IM messages
68 * @param sipe_private SIPE core private data
69 * @param session session for the IM conversation(s)
70 * @param callid Call ID of the conversation
71 * @param with URI of the remote party
73 void sipe_im_cancel_unconfirmed(struct sipe_core_private *sipe_private,
74 struct sip_session *session,
75 const gchar *callid,
76 const gchar *with);
78 /**
79 * Re-enqueue unconfirmed IM messages
81 * @param sipe_private SIPE core private data
82 * @param session session for the IM conversation(s)
83 * @param callid Call ID of the conversation
84 * @param with URI of the remote party
86 void sipe_im_reenqueue_unconfirmed(struct sipe_core_private *sipe_private,
87 struct sip_session *session,
88 const gchar *callid,
89 const gchar *with);
91 typedef void (*unconfirmed_callback)(struct sipe_core_private *sipe_private,
92 struct sip_session *session,
93 const gchar *callid,
94 const gchar *with);
96 /**
97 * Close dangling IM session
99 * @param sipe_private (in) SIPE core data.
100 * @param session (in) pointer to session
101 * @param dialog (in) pointer to dialog
102 * @param with (in) URI of dialog partner
103 * @param callback (in) callback for unconfirmed message
105 void sipe_im_cancel_dangling(struct sipe_core_private *sipe_private,
106 struct sip_session *session,
107 struct sip_dialog *dialog,
108 const gchar *with,
109 unconfirmed_callback callback);
112 * Sets a topic for IM conversation
114 * @param sipe_private (in) SIPE core data
115 * @param session (in) pointer to session
116 * @param topic (in) string describing conversation topic
118 void sipe_im_topic(struct sipe_core_private *sipe_private,
119 struct sip_session *session,
120 const gchar *topic);
123 * Processes INFO message with application/xml+conversationinfo content type
125 * @param sipe_private (in) SIPE core data
126 * @param msg (in) SIP INFO message
128 void process_incoming_info_conversation(struct sipe_core_private *sipe_private,
129 struct sipmsg *msg);