source: otr.h @ 0529a7f

Last change on this file since 0529a7f was 0529a7f, checked in by Sven Moritz Hallberg <sm@…>, at 2008-02-12T00:08:43Z

bugfix for compiling with otr disabled

  • Property mode set to 100644
File size: 2.6 KB
Line 
1  /********************************************************************\
2  * BitlBee -- An IRC to other IM-networks gateway                     *
3  *                                                                    *
4  * Copyright 2002-2008 Wilmer van der Gaast and others                *
5  \********************************************************************/
6
7/*
8  OTR support (cf. http://www.cypherpunks.ca/otr/)
9  2008, Sven Moritz Hallberg <pesco@khjk.org>
10*/
11
12/*
13  This program is free software; you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation; either version 2 of the License, or
16  (at your option) any later version.
17
18  This program is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  GNU General Public License for more details.
22
23  You should have received a copy of the GNU General Public License with
24  the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
25  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
26  Suite 330, Boston, MA  02111-1307  USA
27*/
28
29#ifndef BITLBEE_PROTOCOLS_OTR_H
30#define BITLBEE_PROTOCOLS_OTR_H
31
32#include "bitlbee.h"
33
34
35// forward decls to avoid mutual dependencies
36struct irc;
37struct im_connection;
38struct account;
39
40// 'otr' root command, hooked up in root_commands.c
41void cmd_otr(struct irc *, char **args);
42
43
44#ifdef WITH_OTR
45#include <libotr/proto.h>
46#include <libotr/message.h>
47#include <libotr/privkey.h>
48
49/* called from main() */
50void otr_init(void);
51
52/* called by storage_* functions */
53void otr_load(struct irc *irc);
54void otr_save(struct irc *irc);
55void otr_remove(const char *nick);
56void otr_rename(const char *onick, const char *nnick);
57
58/* called from account_add() */
59void otr_check_for_key(struct account *a);
60
61/* called from imcb_buddy_msg() */
62char *otr_handle_message(struct im_connection *ic, const char *handle,
63        const char *msg);
64       
65/* called from imc_buddy_msg() */
66int otr_send_message(struct im_connection *ic, const char *handle, const char *msg,
67        int flags);
68
69#else
70
71typedef void *OtrlUserState;
72typedef void *OtrlMessageAppOps;
73
74#define otrl_userstate_create() (NULL)
75#define otrl_userstate_free(us) {}
76
77#define otr_init() {}
78#define otr_load(irc) {}
79#define otr_save(irc) {}
80#define otr_remove(nick) {}
81#define otr_rename(onick,nnick) {}
82#define otr_check_for_key(acc) {}
83#define otr_handle_message(ic,handle,msg) (g_strdup(msg))
84#define otr_send_message(ic,h,m,f) (ic->acc->prpl->buddy_msg(ic,h,m,f))
85
86void cmd_otr_nosupport(void *, char **);
87
88#endif
89#endif
Note: See TracBrowser for help on using the repository browser.