Set nicknames colors per muc, not for all of them ! Keep nick color on
nick change. Closes #2264.
This commit is contained in:
parent
23396f8f59
commit
8af50e298f
1 changed files with 11 additions and 9 deletions
|
@ -534,20 +534,19 @@ class GroupchatControl(ChatControlBase):
|
||||||
if kind == 'incoming': # it's a message NOT from us
|
if kind == 'incoming': # it's a message NOT from us
|
||||||
# highlighting and sounds
|
# highlighting and sounds
|
||||||
(highlight, sound) = self.highlighting_for_message(text, tim)
|
(highlight, sound) = self.highlighting_for_message(text, tim)
|
||||||
gc_class=self.__class__
|
if self.gc_custom_colors.has_key(contact):
|
||||||
if gc_class.gc_custom_colors.has_key(contact):
|
|
||||||
other_tags_for_name.append('gc_nickname_color_' + \
|
other_tags_for_name.append('gc_nickname_color_' + \
|
||||||
str(gc_class.gc_custom_colors[contact]))
|
str(self.gc_custom_colors[contact]))
|
||||||
else:
|
else:
|
||||||
gc_class.gc_count_nicknames_colors += 1
|
self.gc_count_nicknames_colors += 1
|
||||||
number_of_colors = len(gajim.config.get('gc_nicknames_colors').\
|
number_of_colors = len(gajim.config.get('gc_nicknames_colors').\
|
||||||
split(':'))
|
split(':'))
|
||||||
if gc_class.gc_count_nicknames_colors == number_of_colors:
|
if self.gc_count_nicknames_colors == number_of_colors:
|
||||||
gc_class.gc_count_nicknames_colors = 0
|
self.gc_count_nicknames_colors = 0
|
||||||
gc_class.gc_custom_colors[contact] = \
|
self.gc_custom_colors[contact] = \
|
||||||
gc_class.gc_count_nicknames_colors
|
self.gc_count_nicknames_colors
|
||||||
other_tags_for_name.append('gc_nickname_color_' + \
|
other_tags_for_name.append('gc_nickname_color_' + \
|
||||||
str(gc_class.gc_count_nicknames_colors))
|
str(self.gc_count_nicknames_colors))
|
||||||
if highlight:
|
if highlight:
|
||||||
# muc-specific chatstate
|
# muc-specific chatstate
|
||||||
self.parent_win.redraw_tab(self, 'attention')
|
self.parent_win.redraw_tab(self, 'attention')
|
||||||
|
@ -778,6 +777,9 @@ class GroupchatControl(ChatControlBase):
|
||||||
# after that, but that doesn't hurt
|
# after that, but that doesn't hurt
|
||||||
self.add_contact_to_roster(new_nick, show, role, affiliation,
|
self.add_contact_to_roster(new_nick, show, role, affiliation,
|
||||||
status, jid)
|
status, jid)
|
||||||
|
# keep nickname color
|
||||||
|
self.gc_custom_colors[new_nick] =\
|
||||||
|
self.gc_custom_colors[nick]
|
||||||
# rename vcard / avatar
|
# rename vcard / avatar
|
||||||
puny_jid = helpers.sanitize_filename(self.room_jid)
|
puny_jid = helpers.sanitize_filename(self.room_jid)
|
||||||
puny_nick = helpers.sanitize_filename(nick)
|
puny_nick = helpers.sanitize_filename(nick)
|
||||||
|
|
Loading…
Add table
Reference in a new issue