From 6dfa9c7e35d67fa3830b5629d6861283a51d5519 Mon Sep 17 00:00:00 2001 From: js Date: Tue, 29 Jul 2008 00:11:44 +0000 Subject: [PATCH] * Fix a TB with unknown moods * Add the 'thoughtful' mood in the Gajim namespace (trying to get it in the XEP!) --- src/common/pep.py | 9 +++++++-- src/roster_window.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/common/pep.py b/src/common/pep.py index f5db85593..5510aa3a1 100644 --- a/src/common/pep.py +++ b/src/common/pep.py @@ -9,7 +9,11 @@ MOODS = ['afraid', 'amazed', 'angry', 'annoyed', 'anxious', 'aroused', 'intoxicated', 'invincible', 'jealous', 'lonely', 'mean', 'moody', 'nervous', 'neutral', 'offended', 'playful', 'proud', 'relieved', 'remorseful', 'restless', 'sad', 'sarcastic', 'serious', 'shocked', - 'shy', 'sick', 'sleepy', 'stressed', 'surprised', 'thirsty', 'worried'] + 'shy', 'sick', 'sleepy', 'stressed', 'surprised', 'thirsty', + 'thoughtful', 'worried'] + +# These moods are only available in the Gajim namespace +GAJIM_MOODS = ['thoughtful'] ACTIVITIES = { 'doing_chores': {'category': _('Doing Chores'), @@ -371,7 +375,8 @@ def user_send_mood(account, mood, message = ''): return item = xmpp.Node('mood', {'xmlns': xmpp.NS_MOOD}) if mood != '': - item.addChild(mood) + item.addChild(mood, namespace = 'http://gajim.org/moods' \ + if mood in GAJIM_MOODS else None) if message != '': i = item.addChild('text') i.addData(message) diff --git a/src/roster_window.py b/src/roster_window.py index 960ed1cf2..09ebc03a9 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1240,7 +1240,7 @@ class RosterWindow: pixbuf = gtkgui_helpers.load_mood_icon( contact.mood['mood']).get_pixbuf() elif contact.mood.has_key('mood'): - pixbuf = gtkgui_helpers.load_mood_image( + pixbuf = gtkgui_helpers.load_mood_icon( 'unknown').get_pixbuf() else: pixbuf = None