roster-state-colors.diff
changeset 85 93c3cc0d7891
parent 57 cfa24a16e928
child 87 78238d26911a
equal deleted inserted replaced
84:6ff846816073 85:93c3cc0d7891
     1 Change roster item colors on chatstate change
     1 Change roster item colors on chatstate change
     2 
     2 
     3 diff -r 1c4b2c41f849 mcabber/contrib/themes/light.txt
     3 diff -r 7718e7f796d4 mcabber/contrib/themes/light.txt
     4 --- a/mcabber/contrib/themes/light.txt	Mon Nov 26 19:33:15 2012 +0200
     4 --- a/mcabber/contrib/themes/light.txt	Wed May 15 12:53:03 2013 +0300
     5 +++ b/mcabber/contrib/themes/light.txt	Mon Nov 26 19:33:24 2012 +0200
     5 +++ b/mcabber/contrib/themes/light.txt	Wed May 15 12:53:55 2013 +0300
     6 @@ -14,7 +14,6 @@
     6 @@ -14,7 +14,6 @@
     7  set color_bgrostersel  = green
     7  set color_bgrostersel  = green
     8  set color_rostersel    = yellow
     8  set color_rostersel    = yellow
     9  set color_rosterselmsg = red
     9  set color_rosterselmsg = red
    10 -set color_rosternewmsg = red
    10 -set color_rosternewmsg = red
    11  set color_readmark     = red
    11  set color_readmark     = red
    12  
    12  
    13  # vim:set ft=conf:
    13  # vim:set ft=conf:
    14 diff -r 1c4b2c41f849 mcabber/contrib/themes/light2.txt
    14 diff -r 7718e7f796d4 mcabber/contrib/themes/light2.txt
    15 --- a/mcabber/contrib/themes/light2.txt	Mon Nov 26 19:33:15 2012 +0200
    15 --- a/mcabber/contrib/themes/light2.txt	Wed May 15 12:53:03 2013 +0300
    16 +++ b/mcabber/contrib/themes/light2.txt	Mon Nov 26 19:33:24 2012 +0200
    16 +++ b/mcabber/contrib/themes/light2.txt	Wed May 15 12:53:55 2013 +0300
    17 @@ -14,7 +14,6 @@
    17 @@ -14,7 +14,6 @@
    18  set color_bgrostersel  = black
    18  set color_bgrostersel  = black
    19  set color_rostersel    = brightgreen
    19  set color_rostersel    = brightgreen
    20  set color_rosterselmsg = red
    20  set color_rosterselmsg = red
    21 -set color_rosternewmsg = red
    21 -set color_rosternewmsg = red
    22  set color_readmark     = red
    22  set color_readmark     = red
    23  
    23  
    24  # vim:set ft=conf:
    24  # vim:set ft=conf:
    25 diff -r 1c4b2c41f849 mcabber/contrib/themes/oliver.txt
    25 diff -r 7718e7f796d4 mcabber/contrib/themes/oliver.txt
    26 --- a/mcabber/contrib/themes/oliver.txt	Mon Nov 26 19:33:15 2012 +0200
    26 --- a/mcabber/contrib/themes/oliver.txt	Wed May 15 12:53:03 2013 +0300
    27 +++ b/mcabber/contrib/themes/oliver.txt	Mon Nov 26 19:33:24 2012 +0200
    27 +++ b/mcabber/contrib/themes/oliver.txt	Wed May 15 12:53:55 2013 +0300
    28 @@ -14,7 +14,6 @@
    28 @@ -14,7 +14,6 @@
    29  set color_bgrostersel  = yellow
    29  set color_bgrostersel  = yellow
    30  set color_rostersel    = blue
    30  set color_rostersel    = blue
    31  set color_rosterselmsg = red
    31  set color_rosterselmsg = red
    32 -set color_rosternewmsg = red
    32 -set color_rosternewmsg = red
    33  set color_readmark     = red
    33  set color_readmark     = red
    34  
    34  
    35  # vim:set ft=conf:
    35  # vim:set ft=conf:
    36 diff -r 1c4b2c41f849 mcabber/doc/help/en/hlp_color.txt
    36 diff -r 7718e7f796d4 mcabber/doc/help/en/hlp_color.txt
    37 --- a/mcabber/doc/help/en/hlp_color.txt	Mon Nov 26 19:33:15 2012 +0200
    37 --- a/mcabber/doc/help/en/hlp_color.txt	Wed May 15 12:53:03 2013 +0300
    38 +++ b/mcabber/doc/help/en/hlp_color.txt	Mon Nov 26 19:33:24 2012 +0200
    38 +++ b/mcabber/doc/help/en/hlp_color.txt	Wed May 15 12:53:55 2013 +0300
    39 @@ -11,6 +11,7 @@
    39 @@ -11,6 +11,7 @@
    40   Set a color rule (or overwrite, if it already exists).  The status is string containing all statuses the roster item can have for the rule to match, or * if any status is OK.  Wildcard is the file-matching wildcard that will be applied to JID.  Color is the wanted color.
    40   Set a color rule (or overwrite, if it already exists).  The status is string containing all statuses the roster item can have for the rule to match, or * if any status is OK.  Wildcard is the file-matching wildcard that will be applied to JID.  Color is the wanted color.
    41   If color is -, the rule is removed.
    41   If color is -, the rule is removed.
    42   If more than one rule matches, the color from the last created (not overwritten) is used.
    42   If more than one rule matches, the color from the last created (not overwritten) is used.
    43 + Also mask can contain symbols '!', '#', '+' and '.', that represent buddies with urgent condition, with new messages, that are typing and that have ceased typing. These symbols have higher priority than status ones.
    43 + Also mask can contain symbols '!', '#', '+' and '.', that represent buddies with urgent condition, with new messages, that are typing and that have ceased typing. These symbols have higher priority than status ones.
    44  /color mucnick nick (color|-)
    44  /color mucnick nick (color|-)
    45   Marks the nick to be colored by given color.  If a MUC has colored nicks, this one will be used.  If color is -, the color is marked as chosen automatically, which means it will not be used in 'preset' coloring mode, but will stay the same in 'on' coloring mode.
    45   Marks the nick to be colored by given color.  If a MUC has colored nicks, this one will be used.  If color is -, the color is marked as chosen automatically, which means it will not be used in 'preset' coloring mode, but will stay the same in 'on' coloring mode.
    46  /color muc (jid|.|*) [on|preset|off|-]
    46  /color muc (jid|.|*) [on|preset|off|-]
    47 diff -r 1c4b2c41f849 mcabber/doc/help/uk/hlp_color.txt
    47 diff -r 7718e7f796d4 mcabber/doc/help/uk/hlp_color.txt
    48 --- a/mcabber/doc/help/uk/hlp_color.txt	Mon Nov 26 19:33:15 2012 +0200
    48 --- a/mcabber/doc/help/uk/hlp_color.txt	Wed May 15 12:53:03 2013 +0300
    49 +++ b/mcabber/doc/help/uk/hlp_color.txt	Mon Nov 26 19:33:24 2012 +0200
    49 +++ b/mcabber/doc/help/uk/hlp_color.txt	Wed May 15 12:53:55 2013 +0300
    50 @@ -11,6 +11,7 @@
    50 @@ -11,6 +11,7 @@
    51   Додає нове чи змінює існуюче правило кольору. "Статус" складений з літер статусу, до яких докладається це правило (наприклад "n_d?"). Зірочка ("*") відповідає будь-якому статусу. "Маска" подібна до файлової маски й докладається до jid. Правило встановлює колір контактів, що йому відповідають.
    51   Додає нове чи змінює існуюче правило кольору. "Статус" складений з літер статусу, до яких докладається це правило (наприклад "n_d?"). Зірочка ("*") відповідає будь-якому статусу. "Маска" подібна до файлової маски й докладається до jid. Правило встановлює колір контактів, що йому відповідають.
    52   Щоб вилучити правило, вкажіть колір "-".
    52   Щоб вилучити правило, вкажіть колір "-".
    53   Коли є декілька правил, що відповідають контакту, спрацьовує останнє додане (_не_ змінене).
    53   Коли є декілька правил, що відповідають контакту, спрацьовує останнє додане (_не_ змінене).
    54 + Також рядок статусів може містити символи '!', '#', '+' та '.', що відповідають користувачам, які відповідно мають негайні події, нові повідомлення, друкують та друкували але спинилися. Ці символи мають більший пріоритет ніж символи статусів.
    54 + Також рядок статусів може містити символи '!', '#', '+' та '.', що відповідають користувачам, які відповідно мають негайні події, нові повідомлення, друкують та друкували але спинилися. Ці символи мають більший пріоритет ніж символи статусів.
    55  /color muc (jid|.|*) [on|preset|off|-]
    55  /color muc (jid|.|*) [on|preset|off|-]
    56   Встановлює режим забарвлення прізвиськ у чаті. Якщо замість jid вказано * режим докладається до всіх чатів, для яких не визначено особистого правила (з вказанням jid).
    56   Встановлює режим забарвлення прізвиськ у чаті. Якщо замість jid вказано * режим докладається до всіх чатів, для яких не визначено особистого правила (з вказанням jid).
    57   У режимі on забарвлюються усі прізвиська, у режимі preset - лише ті, для яких колір встановлено командою /color mucnick, а режим off вимикає забарвлення прізвиськ. Режим - прибирає з вказаних jid особисті режими забарвлення. Тоді до них докладається глобальний. Глобальний режим прибрати не можна.
    57   У режимі on забарвлюються усі прізвиська, у режимі preset - лише ті, для яких колір встановлено командою /color mucnick, а режим off вимикає забарвлення прізвиськ. Режим - прибирає з вказаних jid особисті режими забарвлення. Тоді до них докладається глобальний. Глобальний режим прибрати не можна.
    58 diff -r 1c4b2c41f849 mcabber/mcabber/screen.c
    58 diff -r 7718e7f796d4 mcabber/mcabber/screen.c
    59 --- a/mcabber/mcabber/screen.c	Mon Nov 26 19:33:15 2012 +0200
    59 --- a/mcabber/mcabber/screen.c	Wed May 15 12:53:03 2013 +0300
    60 +++ b/mcabber/mcabber/screen.c	Mon Nov 26 19:33:24 2012 +0200
    60 +++ b/mcabber/mcabber/screen.c	Wed May 15 12:53:55 2013 +0300
    61 @@ -436,7 +436,7 @@
    61 @@ -440,7 +440,7 @@
    62      "roster",
    62      "roster",
    63      "rostersel",
    63      "rostersel",
    64      "rosterselmsg",
    64      "rosterselmsg",
    65 -    "rosternewmsg",
    65 -    "rosternewmsg",
    66 +    "rosternewmsg", /* not removing this to not break binary compatibility with mainstream */
    66 +    "rosternewmsg", /* not removing this to not break binary compatibility with mainstream */
    67      "info",
    67      "info",
    68      "msgin",
    68      "msgin",
    69      "readmark",
    69      "readmark",
    70 @@ -509,10 +509,6 @@
    70 @@ -513,10 +513,6 @@
    71            init_pair(i+1, ((color) ? find_color(color) : COLOR_RED),
    71            init_pair(i+1, ((color) ? find_color(color) : COLOR_RED),
    72                      find_color(backselected));
    72                      find_color(backselected));
    73            break;
    73            break;
    74 -      case COLOR_ROSTERNMSG:
    74 -      case COLOR_ROSTERNMSG:
    75 -          init_pair(i+1, ((color) ? find_color(color) : COLOR_RED),
    75 -          init_pair(i+1, ((color) ? find_color(color) : COLOR_RED),
    76 -                    find_color(background));
    76 -                    find_color(background));
    77 -          break;
    77 -          break;
    78        case COLOR_INFO:
    78        case COLOR_INFO:
    79            init_pair(i+1, ((color) ? find_color(color) : COLOR_WHITE),
    79            init_pair(i+1, ((color) ? find_color(color) : COLOR_WHITE),
    80                      find_color(background));
    80                      find_color(background));
    81 @@ -811,6 +807,21 @@
    81 @@ -815,6 +811,21 @@
    82    settings_set_guard("color_rosterselmsg", scr_color_guard);
    82    settings_set_guard("color_rosterselmsg", scr_color_guard);
    83    settings_set_guard("color_rosternewmsg", scr_color_guard);
    83    settings_set_guard("color_rosternewmsg", scr_color_guard);
    84  
    84  
    85 +  { // Add default rule only if user has not defined one already
    85 +  { // Add default rule only if user has not defined one already
    86 +    GSList *rel;
    86 +    GSList *rel;
    98 +  }
    98 +  }
    99 +
    99 +
   100    getmaxyx(stdscr, maxY, maxX);
   100    getmaxyx(stdscr, maxY, maxX);
   101    Log_Win_Height = DEFAULT_LOG_WIN_HEIGHT;
   101    Log_Win_Height = DEFAULT_LOG_WIN_HEIGHT;
   102    // Note scr_draw_main_window() should be called early after scr_init_curses()
   102    // Note scr_draw_main_window() should be called early after scr_init_curses()
   103 @@ -2078,6 +2089,10 @@
   103 @@ -2082,6 +2093,10 @@
   104      // for unfolded groups.
   104      // for unfolded groups.
   105      if (ismsg && (!isgrp || ishid)) {
   105      if (ismsg && (!isgrp || ishid)) {
   106        pending = '#';
   106        pending = '#';
   107 +      // Attention sign?
   107 +      // Attention sign?
   108 +      if ((ismuc && isurg >= ui_attn_sign_prio_level_muc) ||
   108 +      if ((ismuc && isurg >= ui_attn_sign_prio_level_muc) ||
   109 +          (!ismuc && isurg >= ui_attn_sign_prio_level))
   109 +          (!ismuc && isurg >= ui_attn_sign_prio_level))
   110 +        pending = '!';
   110 +        pending = '!';
   111      }
   111      }
   112  
   112  
   113      if (ismuc) {
   113      if (ismuc) {
   114 @@ -2101,24 +2116,22 @@
   114 @@ -2105,24 +2120,22 @@
   115        for (n = 0; n < maxx; n++)
   115        for (n = 0; n < maxx; n++)
   116          waddch(rosterWnd, ' ');
   116          waddch(rosterWnd, ' ');
   117      } else {
   117      } else {
   118 -      if (pending == '#')
   118 -      if (pending == '#')
   119 -        wattrset(rosterWnd, get_color(COLOR_ROSTERNMSG));
   119 -        wattrset(rosterWnd, get_color(COLOR_ROSTERNMSG));
   147        }
   147        }
   148 +      wattrset(rosterWnd, color);
   148 +      wattrset(rosterWnd, color);
   149      }
   149      }
   150  
   150  
   151      if (Roster_Width > prefix_length)
   151      if (Roster_Width > prefix_length)
   152 @@ -2126,13 +2139,6 @@
   152 @@ -2130,13 +2143,6 @@
   153      else
   153      else
   154        name[0] = 0;
   154        name[0] = 0;
   155  
   155  
   156 -    if (pending == '#') {
   156 -    if (pending == '#') {
   157 -      // Attention sign?
   157 -      // Attention sign?
   161 -    }
   161 -    }
   162 -
   162 -
   163      if (isgrp) {
   163      if (isgrp) {
   164        if (ishid) {
   164        if (ishid) {
   165          int group_count = 0;
   165          int group_count = 0;
   166 diff -r 1c4b2c41f849 mcabber/mcabber/screen.h
   166 diff -r 7718e7f796d4 mcabber/mcabber/screen.h
   167 --- a/mcabber/mcabber/screen.h	Mon Nov 26 19:33:15 2012 +0200
   167 --- a/mcabber/mcabber/screen.h	Wed May 15 12:53:03 2013 +0300
   168 +++ b/mcabber/mcabber/screen.h	Mon Nov 26 19:33:24 2012 +0200
   168 +++ b/mcabber/mcabber/screen.h	Wed May 15 12:53:55 2013 +0300
   169 @@ -47,7 +47,7 @@
   169 @@ -47,7 +47,7 @@
   170    COLOR_ROSTER,
   170    COLOR_ROSTER,
   171    COLOR_ROSTERSEL,
   171    COLOR_ROSTERSEL,
   172    COLOR_ROSTERSELNMSG,
   172    COLOR_ROSTERSELNMSG,
   173 -  COLOR_ROSTERNMSG,
   173 -  COLOR_ROSTERNMSG,
   174 +  COLOR_ROSTERNMSG, /* not removing this to not break binary compatibility with mainstream */
   174 +  COLOR_ROSTERNMSG, /* not removing this to not break binary compatibility with mainstream */
   175    COLOR_INFO,
   175    COLOR_INFO,
   176    COLOR_MSGIN,
   176    COLOR_MSGIN,
   177    COLOR_READMARK,
   177    COLOR_READMARK,
   178 diff -r 1c4b2c41f849 mcabber/mcabberrc.example
   178 diff -r 7718e7f796d4 mcabber/mcabberrc.example
   179 --- a/mcabber/mcabberrc.example	Mon Nov 26 19:33:15 2012 +0200
   179 --- a/mcabber/mcabberrc.example	Wed May 15 12:53:03 2013 +0300
   180 +++ b/mcabber/mcabberrc.example	Mon Nov 26 19:33:24 2012 +0200
   180 +++ b/mcabber/mcabberrc.example	Wed May 15 12:53:55 2013 +0300
   181 @@ -399,7 +399,6 @@
   181 @@ -423,15 +423,24 @@
   182  # bgrostersel: background color of the selected roster item
       
   183  # rostersel:   text color of the selected roster item
       
   184  # rosterselmsg:text color of the selected roster item, if there is a new msg
       
   185 -# rosternewmsg: text color of items with unread messages
       
   186  #
       
   187  #set color_background   = black
       
   188  #set color_general      = white
       
   189 @@ -414,15 +413,24 @@
       
   190  #set color_bgrostersel  = cyan
   182  #set color_bgrostersel  = cyan
   191  #set color_rostersel    = blue
   183  #set color_rostersel    = blue
   192  #set color_rosterselmsg = red
   184  #set color_rosterselmsg = red
   193 -#set color_rosternewmsg = red
   185 -#set color_rosternewmsg = red
   194  #set color_readmark     = red
   186  #set color_readmark     = red