* Fix a TB with unknown moods
* Add the 'thoughtful' mood in the Gajim namespace (trying to get it in the XEP!)
This commit is contained in:
parent
ec82268bdf
commit
6dfa9c7e35
|
@ -9,7 +9,11 @@ MOODS = ['afraid', 'amazed', 'angry', 'annoyed', 'anxious', 'aroused',
|
||||||
'intoxicated', 'invincible', 'jealous', 'lonely', 'mean', 'moody',
|
'intoxicated', 'invincible', 'jealous', 'lonely', 'mean', 'moody',
|
||||||
'nervous', 'neutral', 'offended', 'playful', 'proud', 'relieved',
|
'nervous', 'neutral', 'offended', 'playful', 'proud', 'relieved',
|
||||||
'remorseful', 'restless', 'sad', 'sarcastic', 'serious', 'shocked',
|
'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 = {
|
ACTIVITIES = {
|
||||||
'doing_chores': {'category': _('Doing Chores'),
|
'doing_chores': {'category': _('Doing Chores'),
|
||||||
|
@ -371,7 +375,8 @@ def user_send_mood(account, mood, message = ''):
|
||||||
return
|
return
|
||||||
item = xmpp.Node('mood', {'xmlns': xmpp.NS_MOOD})
|
item = xmpp.Node('mood', {'xmlns': xmpp.NS_MOOD})
|
||||||
if mood != '':
|
if mood != '':
|
||||||
item.addChild(mood)
|
item.addChild(mood, namespace = 'http://gajim.org/moods' \
|
||||||
|
if mood in GAJIM_MOODS else None)
|
||||||
if message != '':
|
if message != '':
|
||||||
i = item.addChild('text')
|
i = item.addChild('text')
|
||||||
i.addData(message)
|
i.addData(message)
|
||||||
|
|
|
@ -1240,7 +1240,7 @@ class RosterWindow:
|
||||||
pixbuf = gtkgui_helpers.load_mood_icon(
|
pixbuf = gtkgui_helpers.load_mood_icon(
|
||||||
contact.mood['mood']).get_pixbuf()
|
contact.mood['mood']).get_pixbuf()
|
||||||
elif contact.mood.has_key('mood'):
|
elif contact.mood.has_key('mood'):
|
||||||
pixbuf = gtkgui_helpers.load_mood_image(
|
pixbuf = gtkgui_helpers.load_mood_icon(
|
||||||
'unknown').get_pixbuf()
|
'unknown').get_pixbuf()
|
||||||
else:
|
else:
|
||||||
pixbuf = None
|
pixbuf = None
|
||||||
|
|
Loading…
Reference in New Issue