source: otr.h @ 6c91e6e

Last change on this file since 6c91e6e was 6c91e6e, checked in by Sven Moritz Hallberg <sm@…>, at 2008-02-15T00:45:21Z

otr_load error handling + stonedcoder copyright notice

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