Implement automatic nick column formatting 'on-the-fly'

Major improvement: No theme modification required!

Features:
- When nick_column_enabled=OFF: Normal theme behavior
- When nick_column_enabled=ON: Automatic formatting applied

Changes:
1. Enhanced expandos to handle OFF state:
   - expando_nickalign() returns '' when disabled
   - expando_nicktrunc() returns original nick when disabled

2. Added automatic format modification in format_get_text_theme_charargs():
   - Detects message formats (own_msg, pubmsg, etc.)
   - Automatically adds $nickalign prefix
   - Replaces {ownnick $0} with {ownnick $nicktrunc}
   - Replaces {pubnick $0} with {pubnick $nicktrunc}
   - Replaces {menick $0} with {menick $nicktrunc}

3. Restored original theme format:
   - own_msg = '{ownmsgnick $2 {ownnick $0}}$1'
   - No manual $nickalign/$nicktrunc needed

Result: Clean theme compatibility + automatic nick column when enabled

Timestamp: 2025-01-25 00:20
This commit is contained in:
kofany 2025-08-25 00:32:00 +02:00
commit ad0d88b123
3 changed files with 103 additions and 12 deletions

View file

@ -306,14 +306,14 @@ abstracts = {
formats = {
"fe-common/core" = {
own_msg = "$nickalign{ownmsgnick $2 {ownnick $nicktrunc}}$1";
own_msg_channel = "$nickalign{ownmsgnick $3 {ownnick $nicktrunc}{msgchannel $1}}$2";
pubmsg_me = "$nickalign{pubmsgmenick $2 {menick $nicktrunc}}$1";
pubmsg_me_channel = "$nickalign{pubmsgmenick $3 {menick $nicktrunc}{msgchannel $1}}$2";
pubmsg_hilight = "$nickalign{pubmsghinick $0 $3 $nicktrunc}$2";
pubmsg_hilight_channel = "$nickalign{pubmsghinick $0 $4 $nicktrunc{msgchannel $2}}$3";
pubmsg = "$nickalign{pubmsgnick $2 {pubnick $nicktrunc}}$1";
pubmsg_channel = "$nickalign{pubmsgnick $3 {pubnick $nicktrunc}{msgchannel $1}}$2";
own_msg = "{ownmsgnick $2 {ownnick $0}}$1";
own_msg_channel = "{ownmsgnick $3 {ownnick $0}{msgchannel $1}}$2";
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";
pubmsg = "{pubmsgnick $2 {pubnick $0}}$1";
pubmsg_channel = "{pubmsgnick $3 {pubnick $0}{msgchannel $1}}$2";
msg_private = "{privmsg $0 $1}$2";
msg_private_query = "{privmsgnick $0}$2";