Changeset e2b15bb
- Timestamp:
- 2008-02-12T00:01:35Z (17 years ago)
- Branches:
- master
- Children:
- 0529a7f
- Parents:
- 5f4eede
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r5f4eede re2b15bb 119 119 set_add( &irc->set, "op_root", "true", set_eval_op_root, irc ); 120 120 set_add( &irc->set, "op_user", "true", set_eval_op_user, irc ); 121 set_add( &irc->set, "otr_policy", "opportunistic", set_eval_otr_policy, irc ); 121 122 set_add( &irc->set, "password", NULL, passchange, irc ); 122 123 set_add( &irc->set, "private", "true", set_eval_bool, irc ); -
otr.c
r5f4eede re2b15bb 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 files used to store OTR data: 12 <configdir>/<nick>.otr_keys 13 <configdir>/<nick>.otr_fprints 14 15 top-level todos: (search for TODO for more ;-)) 16 integrate otr_load/otr_save with existing storage backends 17 per-account policy settings 18 per-user policy settings 19 */ 20 21 /* 22 This program is free software; you can redistribute it and/or modify 23 it under the terms of the GNU General Public License as published by 24 the Free Software Foundation; either version 2 of the License, or 25 (at your option) any later version. 26 27 This program is distributed in the hope that it will be useful, 28 but WITHOUT ANY WARRANTY; without even the implied warranty of 29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 GNU General Public License for more details. 31 32 You should have received a copy of the GNU General Public License with 33 the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL; 34 if not, write to the Free Software Foundation, Inc., 59 Temple Place, 35 Suite 330, Boston, MA 02111-1307 USA 36 */ 37 1 38 #include "bitlbee.h" 2 39 #ifdef WITH_OTR … … 5 42 #include <sys/types.h> 6 43 #include <unistd.h> 7 8 /**9 files used to store OTR data:10 $configdir/$nick.otr_keys11 $configdir/$nick.otr_fprints12 **/13 44 14 45 … … 345 376 otrl_message_free(otrmsg); 346 377 } else { 347 /* yeah, well, some const casts as usual... ;-) */ 378 /* note: otrl_message_sending handles policy, so that if REQUIRE_ENCRYPTION is set, 379 this case does not occur */ 348 380 st = ic->acc->prpl->buddy_msg( ic, (char *)handle, (char *)msg, flags ); 349 381 } … … 388 420 OtrlPolicy op_policy(void *opdata, ConnContext *context) 389 421 { 390 /* TODO: OTR policy configurable */ 422 struct im_connection *ic = check_imc(opdata, context->accountname, context->protocol); 423 const char *p; 424 425 p = set_getstr(&ic->irc->set, "otr_policy"); 426 if(!strcmp(p, "never")) 427 return OTRL_POLICY_NEVER; 428 if(!strcmp(p, "opportunistic")) 429 return OTRL_POLICY_OPPORTUNISTIC; 430 if(!strcmp(p, "manual")) 431 return OTRL_POLICY_MANUAL; 432 if(!strcmp(p, "always")) 433 return OTRL_POLICY_ALWAYS; 434 391 435 return OTRL_POLICY_OPPORTUNISTIC; 392 436 } … … 858 902 } 859 903 904 /* TODO: allow context specs ("user/proto/account") in 'otr forget fingerprint'? */ 860 905 u = user_find(irc, args[2]); 861 906 if(!u || !u->ic) { … … 893 938 char *s; 894 939 940 /* TODO: allow context specs ("user/proto/account") in 'otr forget contex'? */ 895 941 u = user_find(irc, args[2]); 896 942 if(!u || !u->ic) { -
otr.h
r5f4eede re2b15bb 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 1 29 #ifndef BITLBEE_PROTOCOLS_OTR_H 2 30 #define BITLBEE_PROTOCOLS_OTR_H -
set.c
r5f4eede re2b15bb 369 369 return value; 370 370 } 371 372 /* possible values: never, opportunistic, manual, always */ 373 char *set_eval_otr_policy( set_t *set, char *value ) 374 { 375 if ( !strcmp(value, "never") ) 376 return value; 377 if ( !strcmp(value, "opportunistic") ) 378 return value; 379 if ( !strcmp(value, "manual") ) 380 return value; 381 if ( !strcmp(value, "always") ) 382 return value; 383 return NULL; 384 } -
set.h
r5f4eede re2b15bb 102 102 char *set_eval_voice_buddies( set_t *set, char *value ); 103 103 char *set_eval_charset( set_t *set, char *value ); 104 char *set_eval_otr_policy( set_t *set, char *value ); 104 105 105 106 #endif /* __SET_H__ */
Note: See TracChangeset
for help on using the changeset viewer.