- Timestamp:
- 2008-02-12T00:01:35Z (15 years ago)
- Branches:
- master
- Children:
- 0529a7f
- Parents:
- 5f4eede
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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) {
Note: See TracChangeset
for help on using the changeset viewer.