remove publish_mood, publish_activity and publish_nick options.

This commit is contained in:
Yann Leboulanger 2008-07-29 06:15:41 +00:00
parent 31cb643587
commit e21b1dcb37
4 changed files with 14 additions and 34 deletions

View File

@ -326,10 +326,7 @@ class Config:
'use_env_http_proxy' : [opt_bool, False], 'use_env_http_proxy' : [opt_bool, False],
'answer_receipts' : [opt_bool, True, _('Answer to receipt requests')], 'answer_receipts' : [opt_bool, True, _('Answer to receipt requests')],
'request_receipt' : [opt_bool, True, _('Sent receipt requests')], 'request_receipt' : [opt_bool, True, _('Sent receipt requests')],
'publish_mood': [opt_bool, True],
'publish_activity': [opt_bool, True],
'publish_tune': [opt_bool, False], 'publish_tune': [opt_bool, False],
'publish_nick': [opt_bool, True],
'subscribe_mood': [opt_bool, True], 'subscribe_mood': [opt_bool, True],
'subscribe_activity': [opt_bool, True], 'subscribe_activity': [opt_bool, True],
'subscribe_tune': [opt_bool, True], 'subscribe_tune': [opt_bool, True],

View File

@ -1333,20 +1333,14 @@ def update_optional_features(account = None):
accounts = [a for a in gajim.connections] accounts = [a for a in gajim.connections]
for a in accounts: for a in accounts:
gajim.gajim_optional_features[a] = [] gajim.gajim_optional_features[a] = []
if gajim.config.get_per('accounts', a, 'publish_mood'):
gajim.gajim_optional_features[a].append(xmpp.NS_MOOD)
if gajim.config.get_per('accounts', a, 'subscribe_mood'): if gajim.config.get_per('accounts', a, 'subscribe_mood'):
gajim.gajim_optional_features[a].append(xmpp.NS_MOOD + '+notify') gajim.gajim_optional_features[a].append(xmpp.NS_MOOD + '+notify')
if gajim.config.get_per('accounts', a, 'publish_activity'):
gajim.gajim_optional_features[a].append(xmpp.NS_ACTIVITY)
if gajim.config.get_per('accounts', a, 'subscribe_activity'): if gajim.config.get_per('accounts', a, 'subscribe_activity'):
gajim.gajim_optional_features[a].append(xmpp.NS_ACTIVITY + '+notify') gajim.gajim_optional_features[a].append(xmpp.NS_ACTIVITY + '+notify')
if gajim.config.get_per('accounts', a, 'publish_tune'): if gajim.config.get_per('accounts', a, 'publish_tune'):
gajim.gajim_optional_features[a].append(xmpp.NS_TUNE) gajim.gajim_optional_features[a].append(xmpp.NS_TUNE)
if gajim.config.get_per('accounts', a, 'subscribe_tune'): if gajim.config.get_per('accounts', a, 'subscribe_tune'):
gajim.gajim_optional_features[a].append(xmpp.NS_TUNE + '+notify') gajim.gajim_optional_features[a].append(xmpp.NS_TUNE + '+notify')
if gajim.config.get_per('accounts', a, 'publish_nick'):
gajim.gajim_optional_features[a].append(xmpp.NS_NICK)
if gajim.config.get_per('accounts', a, 'subscribe_nick'): if gajim.config.get_per('accounts', a, 'subscribe_nick'):
gajim.gajim_optional_features[a].append(xmpp.NS_NICK + '+notify') gajim.gajim_optional_features[a].append(xmpp.NS_NICK + '+notify')
if gajim.config.get('outgoing_chat_state_notifactions') != 'disabled': if gajim.config.get('outgoing_chat_state_notifactions') != 'disabled':

View File

@ -371,7 +371,7 @@ def user_nickname(items, name, jid):
contact.contact_name = '' contact.contact_name = ''
def user_send_mood(account, mood, message = ''): def user_send_mood(account, mood, message = ''):
if not gajim.config.get_per('accounts', account, 'publish_mood'): if not gajim.connections[account].pep_supported:
return return
item = xmpp.Node('mood', {'xmlns': xmpp.NS_MOOD}) item = xmpp.Node('mood', {'xmlns': xmpp.NS_MOOD})
if mood != '': if mood != '':
@ -384,7 +384,7 @@ def user_send_mood(account, mood, message = ''):
gajim.connections[account].send_pb_publish('', xmpp.NS_MOOD, item, '0') gajim.connections[account].send_pb_publish('', xmpp.NS_MOOD, item, '0')
def user_send_activity(account, activity, subactivity = '', message = ''): def user_send_activity(account, activity, subactivity = '', message = ''):
if not gajim.config.get_per('accounts', account, 'publish_activity'): if not gajim.connections[account].pep_supported:
return return
item = xmpp.Node('activity', {'xmlns': xmpp.NS_ACTIVITY}) item = xmpp.Node('activity', {'xmlns': xmpp.NS_ACTIVITY})
if activity != '': if activity != '':
@ -425,8 +425,7 @@ length = 0, items = None):
gajim.connections[account].send_pb_publish('', xmpp.NS_TUNE, item, '0') gajim.connections[account].send_pb_publish('', xmpp.NS_TUNE, item, '0')
def user_send_nickname(account, nick): def user_send_nickname(account, nick):
if not (gajim.config.get_per('accounts', account, 'publish_nick') and \ if not gajim.connections[account].pep_supported:
gajim.connections[account].pep_supported):
return return
item = xmpp.Node('nick', {'xmlns': xmpp.NS_NICK}) item = xmpp.Node('nick', {'xmlns': xmpp.NS_NICK})
item.addData(nick) item.addData(nick)

View File

@ -4869,10 +4869,6 @@ class RosterWindow:
pep_menuitem = xml.get_widget('pep_menuitem') pep_menuitem = xml.get_widget('pep_menuitem')
if gajim.connections[account].pep_supported: if gajim.connections[account].pep_supported:
have_mood = gajim.config.get_per('accounts', account,
'publish_mood')
have_activity = gajim.config.get_per('accounts', account,
'publish_activity')
have_tune = gajim.config.get_per('accounts', account, have_tune = gajim.config.get_per('accounts', account,
'publish_tune') 'publish_tune')
pep_submenu = gtk.Menu() pep_submenu = gtk.Menu()
@ -4881,25 +4877,19 @@ class RosterWindow:
pep_submenu.append(item) pep_submenu.append(item)
item.set_active(have_tune) item.set_active(have_tune)
item.connect('toggled', self.on_publish_tune_toggled, account) item.connect('toggled', self.on_publish_tune_toggled, account)
if have_mood: item = gtk.CheckMenuItem(_('Mood'))
item = gtk.CheckMenuItem(_('Mood')) pep_submenu.append(item)
pep_submenu.append(item) item.set_active(len(gajim.connections[account].mood) > 0)
item.set_active(len(gajim.connections[account].mood) > 0) item.connect('activate', self.on_change_mood_activate, account)
item.connect('activate', self.on_change_mood_activate, account) item = gtk.CheckMenuItem(_('Activity'))
if have_activity: pep_submenu.append(item)
item = gtk.CheckMenuItem(_('Activity')) item.set_active(len(gajim.connections[account].activity) > 0)
pep_submenu.append(item) item.connect('activate', self.on_change_activity_activate, account)
item.set_active(len(gajim.connections[account].activity) > 0)
item.connect('activate', self.on_change_activity_activate,
account)
pep_config = gtk.ImageMenuItem(_('Configure Services...')) pep_config = gtk.ImageMenuItem(_('Configure Services...'))
if have_mood or have_activity or have_tune: item = gtk.SeparatorMenuItem()
item = gtk.SeparatorMenuItem() pep_submenu.append(item)
pep_submenu.append(item) pep_config.set_sensitive(True)
pep_config.set_sensitive(True)
else:
pep_config.set_sensitive(False)
pep_submenu.append(pep_config) pep_submenu.append(pep_config)
pep_config.connect('activate', pep_config.connect('activate',
self.on_pep_services_menuitem_activate, account) self.on_pep_services_menuitem_activate, account)