From 1fa2f42b6f050ec054857755c4e07ffcb0d04387 Mon Sep 17 00:00:00 2001 From: kofany Date: Sun, 24 Aug 2025 23:28:05 +0200 Subject: [PATCH] =?UTF-8?q?[2025-08-24=2021:35:00]=20PRZYCINANIE=20NICK?= =?UTF-8?q?=C3=93W=20-=20dodano=20>>=20dla=20d=C5=82ugich=20nick=C3=B3w,?= =?UTF-8?q?=20build=20OK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config_dev | 2 ++ src/fe-common/core/fe-expandos.c | 20 +++++++++++++++++--- themes/default.theme | 20 +++++++++----------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/config_dev b/config_dev index e584e82d..bff51fce 100644 --- a/config_dev +++ b/config_dev @@ -318,6 +318,8 @@ settings = { print_active_channel = "yes"; theme = "default.theme"; nick_column_enabled = "yes"; + nick_column_width = "10"; + debug_nick_column = "no"; }; "fe-text" = { lag_min_show = "1s"; diff --git a/src/fe-common/core/fe-expandos.c b/src/fe-common/core/fe-expandos.c index 3d201f66..b399850f 100644 --- a/src/fe-common/core/fe-expandos.c +++ b/src/fe-common/core/fe-expandos.c @@ -86,9 +86,23 @@ static char *expando_nickalign(SERVER_REC *server, void *item, int *free_ret) nick_chars = count_nick_chars(current_nick); total_chars = mode_chars + nick_chars; - padding = width - total_chars; - if (padding < 0) { - padding = 0; /* Nie może być ujemny */ + if (total_chars > width) { + /* Nick za długi - przytnij z >> */ + int available_for_nick = width - mode_chars - 2; /* -2 dla >> */ + if (available_for_nick > 0) { + /* Przytnij nick i dodaj >> */ + char *truncated = g_strndup(current_nick, available_for_nick); + g_free(current_nick); + current_nick = g_strdup_printf("%s>>", truncated); + g_free(truncated); + } else { + /* Mode sam za długi */ + g_free(current_nick); + current_nick = g_strdup(">>"); + } + padding = 0; + } else { + padding = width - total_chars; } /* Debug output */ diff --git a/themes/default.theme b/themes/default.theme index 72afa258..d1256fe9 100644 --- a/themes/default.theme +++ b/themes/default.theme @@ -135,15 +135,15 @@ abstracts = { # privmsgnick = "%K{msgnick %R$*%K}%n"; # $0 = nick mode, $1 = nick - ownmsgnick = "{msgnick %B$0 $1-}"; + ownmsgnick = "{msgnick %B$0$1-}"; ownnick = "%_%Y$*%n"; # public message in channel, $0 = nick mode, $1 = nick - pubmsgnick = "{msgnick %M$0%N $1%n }"; + pubmsgnick = "{msgnick %M$0%N$1-%n}"; pubnick = "%G$*%n"; # public message in channel meant for me, $0 = nick mode, $1 = nick - pubmsgmenick = "{msgnick $0 $1-}"; + pubmsgmenick = "{msgnick $0$1-}"; menick = "%Y$*%n"; # public highlighted message in channel @@ -307,15 +307,13 @@ formats = { "fe-common/core" = { own_msg = "$nickalign{ownmsgnick $2 {ownnick $0}}$1"; - own_msg_channel = "{ownmsgnick $3 {ownnick $0}{msgchannel $1}}$2"; - own_msg_private = "{ownprivmsg msg $0}$1"; - own_msg_private_query = "{ownprivmsgnick {ownprivnick $2}}$1"; - pubmsg_me = "{pubmsgmenick $2 {menick $0}}$1"; - pubmsg_me_channel = "{pubmsgmenick $3 {menick $0}{msgchannel $1}}$2"; - pubmsg_hilight = "{pubmsghinick $0 $3 $1}$2"; - pubmsg_hilight_channel = "{pubmsghinick $0 $4 $1{msgchannel $2}}$3"; + own_msg_channel = "$nickalign{ownmsgnick $3 {ownnick $0}{msgchannel $1}}$2"; + pubmsg_me = "$nickalign{pubmsgmenick $2 {menick $0}}$1"; + pubmsg_me_channel = "$nickalign{pubmsgmenick $3 {menick $0}{msgchannel $1}}$2"; + pubmsg_hilight = "$nickalign{pubmsghinick $0 $3 $1}$2"; + pubmsg_hilight_channel = "$nickalign{pubmsghinick $0 $4 $1{msgchannel $2}}$3"; pubmsg = "$nickalign{pubmsgnick $2 {pubnick $0}}$1"; - pubmsg_channel = "{pubmsgnick $3 {pubnick $0}{msgchannel $1}}$2"; + pubmsg_channel = "$nickalign{pubmsgnick $3 {pubnick $0}{msgchannel $1}}$2"; msg_private = "{privmsg $0 $1}$2"; msg_private_query = "{privmsgnick $0}$2";