From cec1151ecb577a270b9e1f0ae5eaa238d3269ae8 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 11 Mar 2013 23:06:52 +0100 Subject: Fix #1839 (User mood/activity) - Added as always new theming variables: CHAR_ROSTER_MOOD, CHAR_ROSTER_ACTIVITY (a SNOWMAN!) COLOR_ROSTER_MOOD, COLOR_ROSTER_ACTIVITY - Added two new notification types in Theme.INFO_COLORS (mood/activity) - Added new configuration options: display_mood/activity/tune_notifications (those can be set for a specific JID) enable_user_tune/nick/activity/mood - Added /activity and /mood commands, with completions - Moved the old /activity to /last_activity - Details are show in the ContactInfoWin if there is room, or with "i" on a contact in the roster. --- src/windows.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/windows.py') diff --git a/src/windows.py b/src/windows.py index 78b3c5e5..c4927a6d 100644 --- a/src/windows.py +++ b/src/windows.py @@ -1938,6 +1938,10 @@ class RosterWin(Win): added += len(get_theme().CHAR_ROSTER_ERROR) if contact.tune: added += len(get_theme().CHAR_ROSTER_TUNE) + if contact.mood: + added += len(get_theme().CHAR_ROSTER_MOOD) + if contact.activity: + added += len(get_theme().CHAR_ROSTER_ACTIVITY) if config.getl('show_roster_jids', 'true') == 'false' and contact.name: display_name = '%s' % contact.name @@ -1958,7 +1962,10 @@ class RosterWin(Win): self.addstr(get_theme().CHAR_ROSTER_ERROR, to_curses_attr(get_theme().COLOR_ROSTER_ERROR)) if contact.tune: self.addstr(get_theme().CHAR_ROSTER_TUNE, to_curses_attr(get_theme().COLOR_ROSTER_TUNE)) - + if contact.activity: + self.addstr(get_theme().CHAR_ROSTER_ACTIVITY, to_curses_attr(get_theme().COLOR_ROSTER_ACTIVITY)) + if contact.mood: + self.addstr(get_theme().CHAR_ROSTER_MOOD, to_curses_attr(get_theme().COLOR_ROSTER_MOOD)) self.finish_line() def draw_resource_line(self, y, resource, colored): @@ -2028,6 +2035,14 @@ class ContactInfoWin(Win): self.addstr(i, 0, 'Current Tune: %s' % common.format_tune_string(contact.tune), to_curses_attr(get_theme().COLOR_NORMAL_TEXT)) i += 1 + if contact.mood: + self.addstr(i, 0, 'Mood: %s' % contact.mood, to_curses_attr(get_theme().COLOR_NORMAL_TEXT)) + i += 1 + + if contact.activity: + self.addstr(i, 0, 'Activity: %s' % contact.activity, to_curses_attr(get_theme().COLOR_NORMAL_TEXT)) + i += 1 + def draw_group_info(self, group): """ draw the group information -- cgit v1.2.3