~ubuntu-branches/ubuntu/vivid/pidgin-otr/vivid-proposed

« back to all changes in this revision

Viewing changes to otr-plugin.h

  • Committer: Package Import Robot
  • Author(s): Thibaut VARENE
  • Date: 2012-09-29 12:27:32 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120929122732-vbydcayuggqp8k8b
Tags: 4.0.0-1
New upstream release (Closes: #538644, #549931, #561865)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  Off-the-Record Messaging plugin for pidgin
3
 
 *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
4
 
 *                           Chris Alexander, Nikita Borisov
 
3
 *  Copyright (C) 2004-2012  Ian Goldberg, Rob Smits,
 
4
 *                           Chris Alexander, Willy Lew,
 
5
 *                           Lisa Du, Nikita Borisov
5
6
 *                           <otr@cypherpunks.ca>
6
7
 *
7
8
 *  This program is free software; you can redistribute it and/or modify
15
16
 *
16
17
 *  You should have received a copy of the GNU General Public License
17
18
 *  along with this program; if not, write to the Free Software
18
 
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
20
 */
20
21
 
21
22
#ifndef __OTRG_OTR_PLUGIN_H__
28
29
/* libotr headers */
29
30
#include <libotr/context.h>
30
31
#include <libotr/userstate.h>
 
32
#include <libotr/instag.h>
31
33
 
32
34
#define PRIVKEYFNAME "otr.private_key"
33
35
#define STOREFNAME "otr.fingerprints"
 
36
#define INSTAGFNAME "otr.instance_tags"
34
37
#define MAXMSGSIZEFNAME "otr.max_message_size"
35
38
 
36
39
extern PurplePlugin *otrg_plugin_handle;
37
40
 
38
41
extern OtrlUserState otrg_plugin_userstate;
39
42
 
 
43
/* Given a PurpleConversation, return the ConnContext corresponding to the
 
44
 * selected instance tag. */
 
45
ConnContext* otrg_plugin_conv_to_selected_context(PurpleConversation *conv,
 
46
        int force_create);
 
47
 
 
48
/* Given a PurpleConversation, return the selected instag. */
 
49
otrl_instag_t otrg_plugin_conv_to_selected_instag(PurpleConversation *conv,
 
50
        otrl_instag_t default_value);
 
51
 
40
52
/* Send an IM from the given account to the given recipient.  Display an
41
53
 * error dialog if that account isn't currently logged in. */
42
54
void otrg_plugin_inject_message(PurpleAccount *account, const char *recipient,
46
58
void otrg_plugin_create_privkey(const char *accountname,
47
59
        const char *protocol);
48
60
 
 
61
/* Generate a instance tag for the given accountname/protocol */
 
62
void otrg_plugin_create_instag(const char *accountname,
 
63
        const char *protocol);
 
64
 
49
65
/* Start the Socialist Millionaires' Protocol over the current connection,
50
66
 * using the given initial secret, and optionally a question to pass to
51
67
 * the buddy. */
76
92
void otrg_plugin_write_fingerprints(void);
77
93
 
78
94
/* Find the ConnContext appropriate to a given PurpleConversation. */
79
 
ConnContext *otrg_plugin_conv_to_context(PurpleConversation *conv);
 
95
ConnContext *otrg_plugin_conv_to_context(PurpleConversation *conv,
 
96
        otrl_instag_t their_instance, int force_create);
80
97
 
81
98
/* Find the PurpleConversation appropriate to the given userinfo.  If
82
99
 * one doesn't yet exist, create it if force_create is true. */
88
105
PurpleConversation *otrg_plugin_context_to_conv(ConnContext *context,
89
106
        int force_create);
90
107
 
 
108
 
91
109
typedef enum {
92
110
    TRUST_NOT_PRIVATE,
93
111
    TRUST_UNVERIFIED,