diff options
author | Michael Vetter <jubalh@iodoru.org> | 2022-07-04 16:40:44 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2022-07-04 16:40:44 +0200 |
commit | f30999fd51d2362df01294c8c40cadc746acb9b7 (patch) | |
tree | 62d16b992d6123c77922e5808f98565e3b453ecc | |
parent | 9ef3491228f67403bfc56a756f6a96aa428df610 (diff) | |
download | profani-tty-f30999fd51d2362df01294c8c40cadc746acb9b7.tar.gz |
ox: handle empty message->plain
In case we dont have plain but have body, copy this (like in _sv_ev_incoming_pgp). In case we have neither, return.
-rw-r--r-- | src/event/server_events.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c index 6dae4d9f..57f73c06 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -545,6 +545,14 @@ static void _sv_ev_incoming_ox(ProfChatWin* chatwin, gboolean new_win, ProfMessage* message, gboolean logit) { #ifdef HAVE_LIBGPGME + if (message->plain == NULL) { + if (message->body == NULL) { + log_error("Couldn't decrypt OX message and body was empty"); + return; + } + message->plain = strdup(message->body); + } + //_clean_incoming_message(message); chatwin_incoming_msg(chatwin, message, new_win); log_database_add_incoming(message); |