roster-state-colors
author Myhailo Danylenko <isbear@ukrpost.net>
Fri, 02 Apr 2010 02:48:52 +0300
changeset 1 024f3a2dda3e
child 16 ca5a2f1def20
permissions -rw-r--r--
Add roster-state-colors (hg ignored it for some reason)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     1
diff -r 43a42c3786e8 mcabber/contrib/themes/light.txt
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     2
--- a/mcabber/contrib/themes/light.txt	Fri Apr 02 01:43:23 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     3
+++ b/mcabber/contrib/themes/light.txt	Fri Apr 02 01:44:03 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     4
@@ -13,6 +13,5 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     5
 set color_bgrostersel  = green
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     6
 set color_rostersel    = yellow
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     7
 set color_rosterselmsg = red
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     8
-set color_rosternewmsg = red
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     9
 
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    10
 # vim:set ft=conf:
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    11
diff -r 43a42c3786e8 mcabber/contrib/themes/light2.txt
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    12
--- a/mcabber/contrib/themes/light2.txt	Fri Apr 02 01:43:23 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    13
+++ b/mcabber/contrib/themes/light2.txt	Fri Apr 02 01:44:03 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    14
@@ -13,6 +13,5 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    15
 set color_bgrostersel  = black
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    16
 set color_rostersel    = brightgreen
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    17
 set color_rosterselmsg = red
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    18
-set color_rosternewmsg = red
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    19
 
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    20
 # vim:set ft=conf:
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    21
diff -r 43a42c3786e8 mcabber/contrib/themes/oliver.txt
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    22
--- a/mcabber/contrib/themes/oliver.txt	Fri Apr 02 01:43:23 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    23
+++ b/mcabber/contrib/themes/oliver.txt	Fri Apr 02 01:44:03 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    24
@@ -13,6 +13,5 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    25
 set color_bgrostersel  = yellow
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    26
 set color_rostersel    = blue
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    27
 set color_rosterselmsg = red
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    28
-set color_rosternewmsg = red
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    29
 
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    30
 # vim:set ft=conf:
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    31
diff -r 43a42c3786e8 mcabber/doc/help/en/hlp_color.txt
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    32
--- a/mcabber/doc/help/en/hlp_color.txt	Fri Apr 02 01:43:23 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    33
+++ b/mcabber/doc/help/en/hlp_color.txt	Fri Apr 02 01:44:03 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    34
@@ -11,6 +11,7 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    35
  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.
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    36
  If color is -, the rule is removed.
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    37
  If more than one rule matches, the color from the last created (not overwritten) is used.
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    38
+ 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.
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    39
 /color mucnick nick (color|-)
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    40
  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.
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    41
 /color muc (jid|.|*) [on|preset|off|-]
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    42
diff -r 43a42c3786e8 mcabber/doc/help/uk/hlp_color.txt
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    43
--- a/mcabber/doc/help/uk/hlp_color.txt	Fri Apr 02 01:43:23 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    44
+++ b/mcabber/doc/help/uk/hlp_color.txt	Fri Apr 02 01:44:03 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    45
@@ -11,6 +11,7 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    46
  Додає нове чи змінює існуюче правило кольору. "Статус" складений з літер статусу, до яких докладається це правило (наприклад "n_d?"). Зірочка ("*") відповідає будь-якому статусу. "Маска" подібна до файлової маски й докладається до jid. Правило встановлює колір контактів, що йому відповідають.
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    47
  Щоб вилучити правило, вкажіть колір "-".
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    48
  Коли є декілька правил, що відповідають контакту, спрацьовує останнє додане (_не_ змінене).
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    49
+ Також рядок статусів може містити символи '!', '#', '+' та '.', що відповідають користувачам, які відповідно мають негайні події, нові повідомлення, друкують та друкували але спинилися. Ці символи мають більший пріоритет ніж символи статусів.
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    50
 /color muc (jid|.|*) [on|preset|off|-]
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    51
  Встановлює режим забарвлення прізвиськ у чаті. Якщо замість jid вказано * режим докладається до всіх чатів, для яких не визначено особистого правила (з вказанням jid).
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    52
  У режимі on забарвлюються усі прізвиська, у режимі preset - лише ті, для яких колір встановлено командою /color mucnick, а режим off вимикає забарвлення прізвиськ. Режим - прибирає з вказаних jid особисті режими забарвлення. Тоді до них докладається глобальний. Глобальний режим прибрати не можна.
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    53
diff -r 43a42c3786e8 mcabber/mcabber/screen.c
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    54
--- a/mcabber/mcabber/screen.c	Fri Apr 02 01:43:23 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    55
+++ b/mcabber/mcabber/screen.c	Fri Apr 02 01:44:03 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    56
@@ -438,7 +438,7 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    57
     "roster",
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    58
     "rostersel",
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    59
     "rosterselmsg",
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    60
-    "rosternewmsg",
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    61
+    "rosternewmsg", /* not removing this to not break binary compatibility with mainstream */
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    62
     "info",
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    63
     "msgin",
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    64
     NULL
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    65
@@ -506,10 +506,6 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    66
           init_pair(i+1, ((color) ? find_color(color) : COLOR_RED),
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    67
                     find_color(backselected));
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    68
           break;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    69
-      case COLOR_ROSTERNMSG:
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    70
-          init_pair(i+1, ((color) ? find_color(color) : COLOR_RED),
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    71
-                    find_color(background));
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    72
-          break;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    73
       case COLOR_INFO:
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    74
           init_pair(i+1, ((color) ? find_color(color) : COLOR_WHITE),
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    75
                     find_color(background));
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    76
@@ -802,6 +798,21 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    77
   settings_set_guard("color_rostersel", scr_color_guard);
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    78
   settings_set_guard("color_rosterselmsg", scr_color_guard);
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    79
 
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    80
+  { // Add default rule only if user has not defined one already
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    81
+    GSList *rel;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    82
+    gboolean found = FALSE;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    83
+    for (rel = rostercolrules; rel; rel = rel->next) {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    84
+      rostercolor *rule = rel->data;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    85
+      if ((strchr(rule->status, '#') || strchr(rule->status, '!'))
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    86
+          && (!strcmp(rule->wildcard, "*"))) {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    87
+        found = TRUE;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    88
+        break;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    89
+      }
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    90
+    }
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    91
+    if (!found)
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    92
+      scr_roster_color("#!", "*", "red");
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    93
+  }
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    94
+
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    95
   getmaxyx(stdscr, maxY, maxX);
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    96
   Log_Win_Height = DEFAULT_LOG_WIN_HEIGHT;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    97
   // Note scr_draw_main_window() should be called early after scr_init_curses()
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    98
@@ -1985,6 +1996,10 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    99
     // for unfolded groups.
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   100
     if (ismsg && (!isgrp || ishid)) {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   101
       pending = '#';
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   102
+      // Attention sign?
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   103
+      if ((ismuc && isurg >= ui_attn_sign_prio_level_muc) ||
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   104
+          (!ismuc && isurg >= ui_attn_sign_prio_level))
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   105
+        pending = '!';
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   106
     }
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   107
 
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   108
     if (ismuc) {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   109
@@ -2008,24 +2023,22 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   110
       for (n = 0; n < maxx; n++)
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   111
         waddch(rosterWnd, ' ');
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   112
     } else {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   113
-      if (pending == '#')
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   114
-        wattrset(rosterWnd, get_color(COLOR_ROSTERNMSG));
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   115
-      else {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   116
-        int color = get_color(COLOR_ROSTER);
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   117
-        if ((!isspe) && (!isgrp)) { // Look for color rules
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   118
-          GSList *head;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   119
-          const char *bjid = buddy_getjid(BUDDATA(buddy));
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   120
-          for (head = rostercolrules; head; head = g_slist_next(head)) {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   121
-            rostercolor *rc = head->data;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   122
-            if (g_pattern_match_string(rc->compiled, bjid) &&
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   123
-                (!strcmp("*", rc->status) || strchr(rc->status, status))) {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   124
-              color = compose_color(rc->color);
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   125
-              break;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   126
-            }
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   127
+      int color = get_color(COLOR_ROSTER);
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   128
+      if ((!isspe) && (!isgrp)) { // Look for color rules
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   129
+        GSList *head;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   130
+        const char *jid = buddy_getjid(BUDDATA(buddy));
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   131
+        for (head = rostercolrules; head; head = g_slist_next(head)) {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   132
+          rostercolor *rc = head->data;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   133
+          if (g_pattern_match_string(rc->compiled, jid) &&
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   134
+              (!strcmp("*", rc->status) ||
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   135
+               strchr(rc->status, pending) ||
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   136
+               strchr(rc->status, status))) {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   137
+            color = compose_color(rc->color);
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   138
+            break;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   139
           }
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   140
         }
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   141
-        wattrset(rosterWnd, color);
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   142
       }
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   143
+      wattrset(rosterWnd, color);
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   144
     }
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   145
 
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   146
     if (Roster_Width > 7)
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   147
@@ -2033,13 +2046,6 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   148
     else
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   149
       name[0] = 0;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   150
 
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   151
-    if (pending == '#') {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   152
-      // Attention sign?
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   153
-      if ((ismuc && isurg >= ui_attn_sign_prio_level_muc) ||
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   154
-          (!ismuc && isurg >= ui_attn_sign_prio_level))
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   155
-        pending = '!';
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   156
-    }
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   157
-
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   158
     if (isgrp) {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   159
       if (ishid) {
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   160
         int group_count = 0;
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   161
diff -r 43a42c3786e8 mcabber/mcabber/screen.h
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   162
--- a/mcabber/mcabber/screen.h	Fri Apr 02 01:43:23 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   163
+++ b/mcabber/mcabber/screen.h	Fri Apr 02 01:44:03 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   164
@@ -46,7 +46,7 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   165
   COLOR_ROSTER,
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   166
   COLOR_ROSTERSEL,
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   167
   COLOR_ROSTERSELNMSG,
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   168
-  COLOR_ROSTERNMSG,
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   169
+  COLOR_ROSTERNMSG, /* not removing this to not break binary compatibility with mainstream */
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   170
   COLOR_INFO,
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   171
   COLOR_MSGIN,
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   172
   COLOR_max
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   173
diff -r 43a42c3786e8 mcabber/mcabberrc.example
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   174
--- a/mcabber/mcabberrc.example	Fri Apr 02 01:43:23 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   175
+++ b/mcabber/mcabberrc.example	Fri Apr 02 01:44:03 2010 +0300
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   176
@@ -360,7 +360,6 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   177
 # bgrostersel: background color of the selected roster item
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   178
 # rostersel:   text color of the selected roster item
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   179
 # rosterselmsg:text color of the selected roster item, if there is a new msg
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   180
-# rosternewmsg: text color of items with unread messages
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   181
 #
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   182
 #set color_background   = black
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   183
 #set color_general      = white
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   184
@@ -374,14 +373,23 @@
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   185
 #set color_bgrostersel  = cyan
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   186
 #set color_rostersel    = blue
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   187
 #set color_rosterselmsg = red
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   188
-#set color_rosternewmsg = red
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   189
 
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   190
-# You can color roster items by their status and JID.  For example, to have
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   191
-# all roster items white, just all contacts from jabber.org that are away,
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   192
-# not available or do not disturb yellow, you do this:
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   193
+# You can color roster items by their status, state and JID.  For example,
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   194
+# to have all roster items white, just all contacts from jabber.org that
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   195
+# are away, not available or do not disturb yellow, you do this:
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   196
 #
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   197
 #color roster * * white
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   198
 #color roster adn *@jabber.org yellow
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   199
+#
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   200
+# You can specify '!', '#', '+' and '.' in status mask, they will take
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   201
+# precedence over status letters and will select buddies accordingly with
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   202
+# urgent condition, with new messages, that are typing and that ceased
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   203
+# typing. By default there exists one rule:
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   204
+#
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   205
+#color roster !# * red
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   206
+#
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   207
+# However, if you define a rule with either '!' or '#', this default rule
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   208
+# will not be added.
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   209
 
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   210
 # You can let mcabber color nicks in MUC.
024f3a2dda3e Add roster-state-colors (hg ignored it for some reason)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   211
 # These colors will by used automatically: