about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-06-08 20:34:24 +0200
committerMichael Vetter <jubalh@iodoru.org>2021-06-08 20:34:24 +0200
commitf20f629bb4e07241a5095fb86960ae6b646ff7c7 (patch)
tree1309be2070b54b34f56690c34fd4a634ab60ad52 /src/ui
parent6bc440c6f7e8c2c40d2d45f5c0decc15821abc8b (diff)
downloadprofani-tty-f20f629bb4e07241a5095fb86960ae6b646ff7c7.tar.gz
Fix multiple mentions in one line
`jubalh: jubalh jubalh` resulted in `20:32:34 - testuser1:
jubalh20:32:34 - testuser1: :  jubalh20:32:34
- testuser1:  jubalh`

Print date/nick only once at beginning of line.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/mucwin.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c
index 54db7a38..54778acb 100644
--- a/src/ui/mucwin.c
+++ b/src/ui/mucwin.c
@@ -396,7 +396,10 @@ _mucwin_print_mention(ProfWin* window, const char* const message, const char* co
             win_append_highlight(window, THEME_ROOMMENTION, "*%s ", from);
             win_append_highlight(window, THEME_ROOMMENTION, "%s", before_str + 4);
         } else {
-            win_print_them(window, THEME_ROOMMENTION, ch, flags, from);
+            // print time and nick only once at beginning of the line
+            if (last_pos == 0) {
+                win_print_them(window, THEME_ROOMMENTION, ch, flags, from);
+            }
             win_append_highlight(window, THEME_ROOMMENTION, "%s", before_str);
         }
         g_free(before_str);