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

View File

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