[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 |
---|
| 8 | struct irc; |
---|
| 9 | struct im_connection; |
---|
| 10 | struct account; |
---|
| 11 | |
---|
| 12 | // 'otr' root command, hooked up in root_commands.c |
---|
| 13 | void 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() */ |
---|
| 22 | void otr_init(void); |
---|
| 23 | |
---|
| 24 | /* called by storage_* functions */ |
---|
| 25 | void otr_load(struct irc *irc); |
---|
| 26 | void otr_save(struct irc *irc); |
---|
| 27 | void otr_remove(const char *nick); |
---|
| 28 | void otr_rename(const char *onick, const char *nnick); |
---|
| 29 | |
---|
| 30 | /* called from account_add() */ |
---|
| 31 | void otr_check_for_key(struct account *a); |
---|
| 32 | |
---|
| 33 | /* called from imcb_buddy_msg() */ |
---|
| 34 | char *otr_handle_message(struct im_connection *ic, const char *handle, |
---|
| 35 | const char *msg); |
---|
| 36 | |
---|
| 37 | /* called from imc_buddy_msg() */ |
---|
| 38 | int otr_send_message(struct im_connection *ic, const char *handle, const char *msg, |
---|
| 39 | int flags); |
---|
| 40 | |
---|
| 41 | #else |
---|
| 42 | |
---|
| 43 | typedef void *OtrlUserState; |
---|
| 44 | typedef 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 | |
---|
| 58 | void cmd_otr_nosupport(void *, char **); |
---|
| 59 | |
---|
| 60 | #endif |
---|
| 61 | #endif |
---|