source: otr.h @ 764c7d1

Last change on this file since 764c7d1 was 764c7d1, checked in by Sven Moritz Hallberg <sm@…>, at 2008-02-03T21:30:03Z

OTR support, first checkin

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[764c7d1]1#ifndef BITLBEE_PROTOCOLS_OTR_H
2#define BITLBEE_PROTOCOLS_OTR_H
3
4#include "bitlbee.h"
5
6
7// forward decls to avoid mutual dependencies
8struct irc;
9struct im_connection;
10struct account;
11
12// 'otr' root command, hooked up in root_commands.c
13void cmd_otr(struct irc *, char **args);
14
15
16#ifdef WITH_OTR
17#include <libotr/proto.h>
18#include <libotr/message.h>
19#include <libotr/privkey.h>
20
21/* called from main() */
22void otr_init(void);
23
24/* called by storage_* functions */
25void otr_load(struct irc *irc);
26void otr_save(struct irc *irc);
27void otr_remove(const char *nick);
28void otr_rename(const char *onick, const char *nnick);
29
30/* called from account_add() */
31void otr_check_for_key(struct account *a);
32
33/* called from imcb_buddy_msg() */
34char *otr_handle_message(struct im_connection *ic, const char *handle,
35        const char *msg);
36       
37/* called from imc_buddy_msg() */
38int otr_send_message(struct im_connection *ic, const char *handle, const char *msg,
39        int flags);
40
41#else
42
43typedef void *OtrlUserState;
44typedef void *OtrlMessageAppOps;
45
46#define otrl_userstate_create() (NULL)
47#define otrl_userstate_free(us) {}
48
49#define otr_init() {}
50#define otr_load(irc) {}
51#define otr_save(irc) {}
52#define otr_remove(nick) {}
53#define otr_rename(onick,nnick) {}
54#define otr_check_for_key(acc) {}
55#define otr_handle_msg(ic,handle,msg) (g_strdup(msg))
56#define otr_send_message(ic,h,m,f) (ic->acc->prpl->buddy_msg(ic,h,m,f))
57
58void cmd_otr_nosupport(void *, char **);
59
60#endif
61#endif
Note: See TracBrowser for help on using the repository browser.