about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-02-15 19:47:09 +0000
committerJames Booth <boothj5@gmail.com>2014-02-15 19:47:36 +0000
commitbdfcc81b075145b5fcf9a089bdff5cffe250dc1f (patch)
tree5574b3e53db8bd04b511dcd77e47a87749b18519
parent9ff7a2a1fee12b41632164884cef41141d57ab85 (diff)
downloadprofani-tty-bdfcc81b075145b5fcf9a089bdff5cffe250dc1f.tar.gz
Only show error message when err != 0
fixes #307
-rw-r--r--src/otr/otrlibv4.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/otr/otrlibv4.c b/src/otr/otrlibv4.c
index c9442a90..f0b58a46 100644
--- a/src/otr/otrlibv4.c
+++ b/src/otr/otrlibv4.c
@@ -62,10 +62,12 @@ cb_handle_msg_event(void *opdata, OtrlMessageEvent msg_event,
     ConnContext *context, const char *message,
     gcry_error_t err)
 {
-    if (message != NULL) {
-        cons_show_error("%s", message);
-    } else {
-        cons_show_error("OTR error event with no message.");
+    if (err != 0) {
+        if (message != NULL) {
+            cons_show_error("%s", message);
+        } else {
+            cons_show_error("OTR error event with no message.");
+        }
     }
 }