comparison mcabber/mcabber/otr.c @ 2251:f3bd1564fa70

Stop html-escaping otr messages and do only strip known tags. We'd like to remove that for good, but pidgin-otr and Adium are still sending html tags.
author franky
date Fri, 19 Feb 2016 22:14:15 +0100
parents 3958793d0d03
children 223827268b2b
comparison
equal deleted inserted replaced
2250:df5837a72b35 2251:f3bd1564fa70
608 */ 608 */
609 char *otr_send(const char *msg, const char *buddy, int *encryption_status) 609 char *otr_send(const char *msg, const char *buddy, int *encryption_status)
610 { 610 {
611 gcry_error_t err; 611 gcry_error_t err;
612 char *newmessage = NULL; 612 char *newmessage = NULL;
613 char *htmlmsg, *rmsg; 613 char *rmsg;
614 ConnContext *ctx = otr_get_context(buddy); 614 ConnContext *ctx = otr_get_context(buddy);
615 615
616 if (!encryption_status) 616 if (!encryption_status)
617 return NULL; 617 return NULL;
618 618
631 ctx->protocol, ctx->username, OTRL_INSTAG_BEST, 631 ctx->protocol, ctx->username, OTRL_INSTAG_BEST,
632 msg, NULL, &newmessage, OTRL_FRAGMENT_SEND_SKIP, 632 msg, NULL, &newmessage, OTRL_FRAGMENT_SEND_SKIP,
633 NULL, NULL, NULL); 633 NULL, NULL, NULL);
634 #endif 634 #endif
635 else { 635 else {
636 htmlmsg = html_escape(msg);
637 err = otrl_message_sending(userstate, &ops, NULL, ctx->accountname, 636 err = otrl_message_sending(userstate, &ops, NULL, ctx->accountname,
638 #ifdef HAVE_LIBOTR3 637 #ifdef HAVE_LIBOTR3
639 ctx->protocol, ctx->username, htmlmsg, NULL, 638 ctx->protocol, ctx->username, msg, NULL,
640 &newmessage, NULL, NULL); 639 &newmessage, NULL, NULL);
641 #else 640 #else
642 // INSTAG XXX 641 // INSTAG XXX
643 ctx->protocol, ctx->username, OTRL_INSTAG_BEST, 642 ctx->protocol, ctx->username, OTRL_INSTAG_BEST,
644 htmlmsg, NULL, &newmessage, OTRL_FRAGMENT_SEND_SKIP, 643 msg, NULL, &newmessage, OTRL_FRAGMENT_SEND_SKIP,
645 NULL, NULL, NULL); 644 NULL, NULL, NULL);
646 #endif 645 #endif
647 g_free(htmlmsg);
648 } 646 }
649 647
650 if (err) 648 if (err)
651 return NULL; /* something went wrong, don't send the plain-message! */ 649 return NULL; /* something went wrong, don't send the plain-message! */
652 650