summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2020-10-09 15:41:22 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2020-10-09 15:44:02 +0200
commit668b0138bb4bb4a01bdaf837d23e45881b46dd8f (patch)
tree82cbee45bfebee8a9e8dd0ef3ef305a5a6866e4a
parent627f751e0c00c0f208e0688698d90a0c186b435b (diff)
downloadpoezio-668b0138bb4bb4a01bdaf837d23e45881b46dd8f.tar.gz
poezio-668b0138bb4bb4a01bdaf837d23e45881b46dd8f.tar.bz2
poezio-668b0138bb4bb4a01bdaf837d23e45881b46dd8f.tar.xz
poezio-668b0138bb4bb4a01bdaf837d23e45881b46dd8f.zip
Revert previous commit, move loggging, fix type error
This reverts commit 627f751e0c00c0f208e0688698d90a0c186b435b. Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/user.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/poezio/user.py b/poezio/user.py
index 1bae612f..5aed5031 100644
--- a/poezio/user.py
+++ b/poezio/user.py
@@ -83,17 +83,15 @@ class User:
self.nick = nick
def change_color(self, color_name: Optional[str], deterministic=False):
- if color_name is None:
+ color = xhtml.colors.get(color_name or '')
+ if color is None:
if deterministic:
self.set_deterministic_color()
else:
+ log.error('Unknown color "%s"', color_name)
self.color = choice(get_theme().LIST_COLOR_NICKNAMES)
else:
- color = xhtml.colors.get(color_name)
- if color is None:
- log.error('Unknown color "%s"', color_name)
- else:
- self.color = (color, -1)
+ self.color = (color, -1)
def set_last_talked(self, time: datetime):
"""