equal
deleted
inserted
replaced
634 NULL, NULL, NULL); |
634 NULL, NULL, NULL); |
635 #endif |
635 #endif |
636 g_free(htmlmsg); |
636 g_free(htmlmsg); |
637 } |
637 } |
638 |
638 |
639 if (err || !newmessage) |
639 if (err) |
640 return NULL; /* something went wrong, don't send the plain-message! */ |
640 return NULL; /* something went wrong, don't send the plain-message! */ |
641 |
641 |
642 if (cb_policy(NULL, ctx) & OTRL_POLICY_REQUIRE_ENCRYPTION || |
642 if (cb_policy(NULL, ctx) & OTRL_POLICY_REQUIRE_ENCRYPTION || |
643 ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) |
643 ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) |
644 *encryption_status = 1; |
644 *encryption_status = 1; |
|
645 |
|
646 if (!newmessage) { |
|
647 if (*encryption_status == 1) |
|
648 return NULL; // This message should have been encrypted |
|
649 |
|
650 // If not, the encryption was not required - send the original message |
|
651 return g_strdup(msg); |
|
652 } |
645 |
653 |
646 /* Check the new message is not empty */ |
654 /* Check the new message is not empty */ |
647 if (newmessage[0] || !msg[0]) { |
655 if (newmessage[0] || !msg[0]) { |
648 rmsg = g_strdup(newmessage); |
656 rmsg = g_strdup(newmessage); |
649 } else { |
657 } else { |