From f95e45d45765518cf7b84730481871eeec37eb1b Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Tue, 29 Nov 2011 11:55:06 +0100
Subject: [PATCH] modify /clear command in groupchats so that it also reset
 color assignment. Fixes #7022

---
 src/command_system/implementation/standard.py | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/command_system/implementation/standard.py b/src/command_system/implementation/standard.py
index 8f26a93f20..8f39e939af 100644
--- a/src/command_system/implementation/standard.py
+++ b/src/command_system/implementation/standard.py
@@ -46,11 +46,6 @@ class StandardCommonCommands(CommandContainer):
     AUTOMATIC = True
     HOSTS = ChatCommands, PrivateChatCommands, GroupChatCommands
 
-    @command
-    @doc(_("Clear the text window"))
-    def clear(self):
-        self.conv_textview.clear()
-
     @command
     @doc(_("Hide the chat buttons"))
     def compact(self):
@@ -168,6 +163,11 @@ class StandardCommonChatCommands(CommandContainer):
     AUTOMATIC = True
     HOSTS = ChatCommands, PrivateChatCommands
 
+    @command
+    @doc(_("Clear the text window"))
+    def clear(self):
+        self.conv_textview.clear()
+
     @command
     @doc(_("Toggle the GPG encryption"))
     def gpg(self):
@@ -240,6 +240,13 @@ class StandardGroupChatCommands(CommandContainer):
     AUTOMATIC = True
     HOSTS = GroupChatCommands,
 
+    @command
+    @doc(_("Clear the text window"))
+    def clear(self):
+        self.conv_textview.clear()
+        self.gc_count_nicknames_colors = -1
+        self.gc_custom_colors = {}
+
     @command(raw=True)
     @doc(_("Change your nickname in a group chat"))
     def nick(self, new_nick):
@@ -353,4 +360,4 @@ class StandardGroupChatCommands(CommandContainer):
     @command('unignore', raw=True)
     @doc(_("Allow an occupant to send you public or private messages"))
     def unblock(self, who):
-        self.on_unblock(None, who)
\ No newline at end of file
+        self.on_unblock(None, who)
-- 
GitLab