chatstate. use default color if chatstate is 'gone'

This commit is contained in:
Denis Fomin
2010-10-03 00:20:31 +04:00
parent 12623b963f
commit c820b8b399
2 changed files with 16 additions and 18 deletions

View File

@@ -47,24 +47,22 @@ class ChatstatePlugin(GajimPlugin):
for child_iter in child_iters:
name = gobject.markup_escape_text(contact.get_shown_name())
theme = gajim.config.get('roster_theme')
color = None
if chatstate == 'composing':
color = gajim.config.get_per('themes', theme,
'state_composing_color')
elif chatstate == 'inactive':
color = gajim.config.get_per('themes', theme,
'state_inactive_color')
elif chatstate == 'gone':
color = gajim.config.get_per('themes', theme,
'state_gone_color')
elif chatstate == 'paused':
color = gajim.config.get_per('themes', theme,
'state_paused_color')
elif chatstate == 'active':
color = gajim.config.get('inmsgcolor')
if chatstate != 'gone':
color = None
if chatstate == 'composing':
color = gajim.config.get_per('themes', theme,
'state_composing_color')
elif chatstate == 'inactive':
color = gajim.config.get_per('themes', theme,
'state_inactive_color')
elif chatstate == 'paused':
color = gajim.config.get_per('themes', theme,
'state_paused_color')
elif chatstate == 'active':
color = gajim.config.get('inmsgcolor')
name = '<span foreground="%s">%s</span>' % (
color, name)
name = '<span foreground="%s">%s</span>' % (
color, name)
if contact.status and gajim.config.get('show_status_msgs_in_roster'):
status = contact.status.strip()
if status != '':

View File

@@ -1,7 +1,7 @@
[info]
name: Chatstate in roster
short_name: chatstate
version: 0.2
version: 0.3
description: Chat State Notifications in roster.
Font color of the contact varies depending on the chat state.
The plugin does not work if you use custom font color for contacts in roster.