Commit c89590b662

c89590b662908029fcb35807cc6d2537735f7d24

parent: 4b4a3a31fe

Unsigned

Denis Kasak <dkasak@termina.org.uk> · 2020-07-09 12:03 UTC

Color profile changes in magenta.

Layout: unified · split

src/render.rs +22 −9
@@ -72,11 +72,14 @@ pub fn render_membership(
7272 _ => ("quit", "red"),
7373 };
7474
75 let color_action = Weechat::color(color_action);
76 let color_reset = Weechat::color("reset");
77
7578 let operation = format!(
7679 "{color_action}{op}{color_reset}",
77 color_action = Weechat::color(color_action),
80 color_action = color_action,
7881 op = operation,
79 color_reset = Weechat::color("reset")
82 color_reset = color_reset
8083 );
8184
8285 let target_name = format!(
@@ -104,37 +107,47 @@ pub fn render_membership(
104107 match (old_display_name != new_display_name, old_avatar != new_avatar) {
105108 (false, true) =>
106109 format!(
107 "{prefix} {target} changed their avatar",
110 "{prefix} {target} {color_action}changed their avatar{color_reset}",
108111 prefix = Weechat::prefix(prefix),
109112 target = target_name,
113 color_action = color_action,
114 color_reset = color_reset
110115 ),
111116 (true, false) => {
112117 match new_display_name {
113118 Some(name) => format!(
114 "{prefix} {target} changed their display name to {new}",
119 "{prefix} {target} {color_action}changed their display name to{color_reset} {new}",
115120 prefix = Weechat::prefix(prefix),
116121 target = target_name,
117 new = name
122 new = name,
123 color_action = color_action,
124 color_reset = color_reset
118125 ),
119126 std::option::Option::None => format!(
120 "{prefix} {target} removed their display name",
127 "{prefix} {target} {color_action}removed their display name{color_reset}",
121128 prefix = Weechat::prefix(prefix),
122129 target = target_name,
130 color_action = color_action,
131 color_reset = color_reset
123132 ),
124133 }
125134 }
126135 (true, true) =>
127136 match new_display_name {
128137 Some(name) => format!(
129 "{prefix} {target} changed their avatar and changed their display name to {new}",
138 "{prefix} {target} {color_action}changed their avatar and changed their display name to{color_reset} {new}",
130139 prefix = Weechat::prefix(prefix),
131140 target = target_name,
132 new = name
141 new = name,
142 color_action = color_action,
143 color_reset = color_reset
133144 ),
134145 std::option::Option::None => format!(
135 "{prefix} {target} changed their avatar and removed display name",
146 "{prefix} {target} {color_action}changed their avatar and removed display name{color_reset}",
136147 prefix = Weechat::prefix(prefix),
137148 target = target_name,
149 color_action = color_action,
150 color_reset = color_reset
138151 ),
139152 }
140153 (false, false) =>