about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/event/client_events.c3
-rw-r--r--src/ui/core.c6
-rw-r--r--src/ui/ui.h1
-rw-r--r--tests/ui/stub_ui.c2
4 files changed, 10 insertions, 2 deletions
diff --git a/src/event/client_events.c b/src/event/client_events.c
index af8b833c..f3c67f63 100644
--- a/src/event/client_events.c
+++ b/src/event/client_events.c
@@ -69,8 +69,7 @@ cl_ev_send_msg(ProfChatWin *chatwin, const char * const msg)
     prof_otrsendres_t res = otr_on_message_send(chatwin->barejid, msg);
     if (res != PROF_OTRSUCCESS) {
         char *errmsg = otr_senderror_str(res);
-        // TODO reference passed window
-        ui_current_error_line(errmsg);
+        ui_win_error_line((ProfWin*)chatwin, errmsg);
     }
 #else
     char *id = message_send_chat(chatwin->barejid, msg);
diff --git a/src/ui/core.c b/src/ui/core.c
index 40f9dbbf..b985e52b 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -1297,6 +1297,12 @@ ui_current_print_formatted_line(const char show_char, int attrs, const char * co
 }
 
 void
+ui_win_error_line(ProfWin *window, const char * const msg)
+{
+    win_print(window, '-', NULL, 0, THEME_ERROR, "", msg);
+}
+
+void
 ui_current_error_line(const char * const msg)
 {
     ProfWin *current = wins_get_current();
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 11457988..e98a105e 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -106,6 +106,7 @@ ProfChatWin *ui_get_current_chat(void);
 void ui_current_print_line(const char * const msg, ...);
 void ui_current_print_formatted_line(const char show_char, int attrs, const char * const msg, ...);
 void ui_current_error_line(const char * const msg);
+void ui_win_error_line(ProfWin *window, const char * const msg);
 
 win_type_t ui_win_type(int index);
 void ui_close_win(int index);
diff --git a/tests/ui/stub_ui.c b/tests/ui/stub_ui.c
index 70be97ef..faea7dd3 100644
--- a/tests/ui/stub_ui.c
+++ b/tests/ui/stub_ui.c
@@ -171,6 +171,8 @@ void ui_current_print_formatted_line(const char show_char, int attrs, const char
 }
 
 void ui_current_error_line(const char * const msg) {}
+void ui_win_error_line(ProfWin *window, const char * const msg) {}
+
 
 win_type_t ui_win_type(int index)
 {