Changeset 71004a3
- Timestamp:
- 2014-02-06T22:51:19Z (11 years ago)
- Branches:
- master
- Children:
- c239fff
- Parents:
- cc17b76 (diff), 329f9fe (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
otr.c
rcc17b76 r71004a3 441 441 int st; 442 442 char *otrmsg = NULL; 443 char *emsg = msg; /* the message as we hand it to libotr */444 443 ConnContext *ctx = NULL; 445 444 irc_t *irc = iu->irc; 446 445 struct im_connection *ic = iu->bu->ic; 447 otrl_instag_t instag = OTRL_INSTAG_RECENT; // XXX? 446 otrl_instag_t instag = OTRL_INSTAG_BEST; // XXX? 447 /* NB: in libotr 4.0.0 OTRL_INSTAG_RECENT will cause a null-pointer deref 448 * in otrl_message_sending with newly-added OTR contexts. 449 */ 448 450 449 451 /* don't do OTR on certain (not classic IM) protocols, e.g. twitter */ … … 454 456 st = otrl_message_sending(irc->otr->us, &otr_ops, ic, 455 457 ic->acc->user, ic->acc->prpl->name, iu->bu->handle, instag, 456 emsg, NULL, &otrmsg, OTRL_FRAGMENT_SEND_SKIP, &ctx, NULL, NULL); 457 /* in libotr 4.0.0 with OTRL_FRAGMENT_SEND_ALL, otrmsg must be passed 458 * but the value it gets carries no meaning. it can be set even though 459 * the message has been injected. 460 * With OTRL_FRAGMENT_SEND_SKIP, libotr doesn't handle the sending, it's 461 * up to us. 462 */ 463 464 if(emsg != msg) { 465 g_free(emsg); /* we're done with this one */ 466 emsg = NULL; 467 } 458 msg, NULL, &otrmsg, OTRL_FRAGMENT_SEND_ALL_BUT_LAST, &ctx, NULL, NULL); 459 460 if(otrmsg && otrmsg != msg) { 461 /* libotr wants us to replace our message */ 462 /* NB: caller will free old msg */ 463 msg = g_strdup(otrmsg); 464 otrl_message_free(otrmsg); 465 } 466 468 467 if(st) { 469 irc_rootmsg(irc, "Error encrypting text for OTR: %d", st); 470 } 471 472 if (otrmsg != NULL) { 473 return otrmsg; 474 } 475 return emsg; 468 irc_usernotice(iu, "otr: error handling outgoing message: %d", st); 469 msg = NULL; /* do not send plaintext! */ 470 } 471 472 return msg; 476 473 } 477 474 … … 1351 1348 irc_user_t *u; 1352 1349 ConnContext *ctx; 1353 otrl_instag_t instag = OTRL_INSTAG_ RECENT; // XXX1350 otrl_instag_t instag = OTRL_INSTAG_BEST; // XXX 1354 1351 1355 1352 u = irc_user_by_name(irc, nick);
Note: See TracChangeset
for help on using the changeset viewer.