about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-06-01 21:23:34 +0100
committerJames Booth <boothj5@gmail.com>2013-06-01 21:23:34 +0100
commitae7da18d7e7fded02153c31d3b0385995528b136 (patch)
tree44136de08fb6703d3e433fb260a2c24c87917400
parent1eba4f5ab1e4148efdbcef22fb16d7c1bf0ed9d5 (diff)
downloadprofani-tty-ae7da18d7e7fded02153c31d3b0385995528b136.tar.gz
Use waddstr for incoming messages to avoid truncation
fixes #8
-rw-r--r--src/ui/core.c15
-rw-r--r--src/xmpp/message.c1
2 files changed, 8 insertions, 8 deletions
diff --git a/src/ui/core.c b/src/ui/core.c
index 8624613b..9f86332e 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -335,7 +335,7 @@ ui_incoming_msg(const char * const from, const char * const message,
         if (strncmp(message, "/me ", 4) == 0) {
             wattron(console->win, COLOUR_THEM);
             wprintw(console->win, "*%s ", display_from);
-            wprintw(console->win, "%s", message + 4);
+            waddstr(console->win, message + 4);
             wprintw(console->win, "\n");
             wattroff(console->win, COLOUR_THEM);
         } else {
@@ -372,7 +372,7 @@ ui_incoming_msg(const char * const from, const char * const message,
             if (strncmp(message, "/me ", 4) == 0) {
                 wattron(window->win, COLOUR_THEM);
                 wprintw(window->win, "*%s ", display_from);
-                wprintw(window->win, "%s", message + 4);
+                waddstr(window->win, message + 4);
                 wprintw(window->win, "\n");
                 wattroff(window->win, COLOUR_THEM);
             } else {
@@ -416,7 +416,7 @@ ui_incoming_msg(const char * const from, const char * const message,
             if (strncmp(message, "/me ", 4) == 0) {
                 wattron(window->win, COLOUR_THEM);
                 wprintw(window->win, "*%s ", display_from);
-                wprintw(window->win, "%s", message + 4);
+                waddstr(window->win, message + 4);
                 wprintw(window->win, "\n");
                 wattroff(window->win, COLOUR_THEM);
             } else {
@@ -1172,7 +1172,7 @@ ui_room_history(const char * const room_jid, const char * const nick,
 
     if (strncmp(message, "/me ", 4) == 0) {
         wprintw(win, "*%s ", nick);
-        wprintw(win, "%s", message + 4);
+        waddstr(win, message + 4);
         wprintw(win, "\n");
     } else {
         wprintw(win, "%s: ", nick);
@@ -1195,7 +1195,7 @@ ui_room_message(const char * const room_jid, const char * const nick,
         if (strncmp(message, "/me ", 4) == 0) {
             wattron(window->win, COLOUR_THEM);
             wprintw(window->win, "*%s ", nick);
-            wprintw(window->win, "%s", message + 4);
+            waddstr(window->win, message + 4);
             wprintw(window->win, "\n");
             wattroff(window->win, COLOUR_THEM);
         } else {
@@ -1207,7 +1207,7 @@ ui_room_message(const char * const room_jid, const char * const nick,
         if (strncmp(message, "/me ", 4) == 0) {
             wattron(window->win, COLOUR_ME);
             wprintw(window->win, "*%s ", nick);
-            wprintw(window->win, "%s", message + 4);
+            waddstr(window->win, message + 4);
             wprintw(window->win, "\n");
             wattroff(window->win, COLOUR_ME);
         } else {
@@ -1456,7 +1456,8 @@ _win_show_user(WINDOW *win, const char * const user, const int colour)
 static void
 _win_show_message(WINDOW *win, const char * const message)
 {
-    wprintw(win, "%s\n", message);
+    waddstr(win, message);
+    wprintw(win, "\n");
 }
 
 static void
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index 6e7ece0a..f8c2fd8f 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -395,6 +395,5 @@ _chat_message_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
         free(jid);
         return 1;
     }
-
 }