annotate mcabber/mcabber/otr.h @ 2213:0c78d31c753d

Change otr_send() prototype This patch updates otr_send() in order to differenciate original and encrypted messages. It should also fix a memory leak of OTR-encrypted messages.
author Mikael Berthe <mikael@lilotux.net>
date Thu, 05 Nov 2015 19:46:09 +0100
parents 9fb1ccf291cc
children
rev   line source
1668
41c26b7d2890 Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1301
diff changeset
1 #ifndef __MCABBER_OTR_H__
41c26b7d2890 Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1301
diff changeset
2 #define __MCABBER_OTR_H__ 1
41c26b7d2890 Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1301
diff changeset
3
41c26b7d2890 Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1301
diff changeset
4 #include <mcabber/config.h>
1299
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
5
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
6 #ifdef HAVE_LIBOTR
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
7
2076
9fb1ccf291cc Switch to libotr v4 API
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1811
diff changeset
8 #ifndef HAVE_LIBOTR3
9fb1ccf291cc Switch to libotr v4 API
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1811
diff changeset
9 # include <libotr/instag.h>
9fb1ccf291cc Switch to libotr v4 API
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1811
diff changeset
10 #endif
1299
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
11 #include <libotr/proto.h>
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
12 #include <libotr/message.h>
1301
37b41ed9ed35 Fixed compiler warnings
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents: 1299
diff changeset
13 #include <libotr/privkey.h>
1299
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
14
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
15 enum otr_policy {
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
16 plain,
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
17 opportunistic,
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
18 manual,
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
19 always
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
20 };
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
21
1301
37b41ed9ed35 Fixed compiler warnings
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents: 1299
diff changeset
22 void otr_init(const char *jid);
1299
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
23 void otr_terminate(void);
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
24
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
25 void otr_establish (const char * buddy);
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
26 void otr_disconnect (const char * buddy);
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
27 void otr_fingerprint(const char * buddy, const char * trust);
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
28 void otr_print_info (const char * buddy);
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
29
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
30 void otr_smp_query (const char * buddy, const char * secret);
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
31 void otr_smp_respond(const char * buddy, const char * secret);
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
32 void otr_smp_abort (const char * buddy);
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
33
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
34 void otr_key (void);
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
35
2213
0c78d31c753d Change otr_send() prototype
Mikael Berthe <mikael@lilotux.net>
parents: 2076
diff changeset
36 int otr_receive (char **otr_data, const char * buddy, int * free_msg);
0c78d31c753d Change otr_send() prototype
Mikael Berthe <mikael@lilotux.net>
parents: 2076
diff changeset
37 char *otr_send (const char * msg, const char * buddy, int * status);
1299
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
38
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
39 #endif /* HAVE_LIBOTR */
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
40
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
41 int otr_enabled (void);
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
42
1668
41c26b7d2890 Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1301
diff changeset
43 #endif /* __MCABBER_OTR_H__ */
1299
3b338a5c01fc OTR support
Frank Zschockelt <mcabber_otr[at]freakysoft.de>
parents:
diff changeset
44
1811
e6d355e50d7a Update Vim modelines
Mikael Berthe <mikael@lilotux.net>
parents: 1668
diff changeset
45 /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */