remove publish_mood, publish_activity and publish_nick options.
This commit is contained in:
parent
31cb643587
commit
e21b1dcb37
|
@ -326,10 +326,7 @@ class Config:
|
|||
'use_env_http_proxy' : [opt_bool, False],
|
||||
'answer_receipts' : [opt_bool, True, _('Answer to 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_nick': [opt_bool, True],
|
||||
'subscribe_mood': [opt_bool, True],
|
||||
'subscribe_activity': [opt_bool, True],
|
||||
'subscribe_tune': [opt_bool, True],
|
||||
|
|
|
@ -1333,20 +1333,14 @@ def update_optional_features(account = None):
|
|||
accounts = [a for a in gajim.connections]
|
||||
for a in accounts:
|
||||
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'):
|
||||
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'):
|
||||
gajim.gajim_optional_features[a].append(xmpp.NS_ACTIVITY + '+notify')
|
||||
if gajim.config.get_per('accounts', a, 'publish_tune'):
|
||||
gajim.gajim_optional_features[a].append(xmpp.NS_TUNE)
|
||||
if gajim.config.get_per('accounts', a, 'subscribe_tune'):
|
||||
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'):
|
||||
gajim.gajim_optional_features[a].append(xmpp.NS_NICK + '+notify')
|
||||
if gajim.config.get('outgoing_chat_state_notifactions') != 'disabled':
|
||||
|
|
|
@ -371,7 +371,7 @@ def user_nickname(items, name, jid):
|
|||
contact.contact_name = ''
|
||||
|
||||
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
|
||||
item = xmpp.Node('mood', {'xmlns': xmpp.NS_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')
|
||||
|
||||
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
|
||||
item = xmpp.Node('activity', {'xmlns': xmpp.NS_ACTIVITY})
|
||||
if activity != '':
|
||||
|
@ -425,8 +425,7 @@ length = 0, items = None):
|
|||
gajim.connections[account].send_pb_publish('', xmpp.NS_TUNE, item, '0')
|
||||
|
||||
def user_send_nickname(account, nick):
|
||||
if not (gajim.config.get_per('accounts', account, 'publish_nick') and \
|
||||
gajim.connections[account].pep_supported):
|
||||
if not gajim.connections[account].pep_supported:
|
||||
return
|
||||
item = xmpp.Node('nick', {'xmlns': xmpp.NS_NICK})
|
||||
item.addData(nick)
|
||||
|
|
|
@ -4869,10 +4869,6 @@ class RosterWindow:
|
|||
|
||||
pep_menuitem = xml.get_widget('pep_menuitem')
|
||||
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,
|
||||
'publish_tune')
|
||||
pep_submenu = gtk.Menu()
|
||||
|
@ -4881,25 +4877,19 @@ class RosterWindow:
|
|||
pep_submenu.append(item)
|
||||
item.set_active(have_tune)
|
||||
item.connect('toggled', self.on_publish_tune_toggled, account)
|
||||
if have_mood:
|
||||
item = gtk.CheckMenuItem(_('Mood'))
|
||||
pep_submenu.append(item)
|
||||
item.set_active(len(gajim.connections[account].mood) > 0)
|
||||
item.connect('activate', self.on_change_mood_activate, account)
|
||||
if have_activity:
|
||||
item = gtk.CheckMenuItem(_('Activity'))
|
||||
pep_submenu.append(item)
|
||||
item.set_active(len(gajim.connections[account].activity) > 0)
|
||||
item.connect('activate', self.on_change_activity_activate,
|
||||
account)
|
||||
item = gtk.CheckMenuItem(_('Mood'))
|
||||
pep_submenu.append(item)
|
||||
item.set_active(len(gajim.connections[account].mood) > 0)
|
||||
item.connect('activate', self.on_change_mood_activate, account)
|
||||
item = gtk.CheckMenuItem(_('Activity'))
|
||||
pep_submenu.append(item)
|
||||
item.set_active(len(gajim.connections[account].activity) > 0)
|
||||
item.connect('activate', self.on_change_activity_activate, account)
|
||||
|
||||
pep_config = gtk.ImageMenuItem(_('Configure Services...'))
|
||||
if have_mood or have_activity or have_tune:
|
||||
item = gtk.SeparatorMenuItem()
|
||||
pep_submenu.append(item)
|
||||
pep_config.set_sensitive(True)
|
||||
else:
|
||||
pep_config.set_sensitive(False)
|
||||
item = gtk.SeparatorMenuItem()
|
||||
pep_submenu.append(item)
|
||||
pep_config.set_sensitive(True)
|
||||
pep_submenu.append(pep_config)
|
||||
pep_config.connect('activate',
|
||||
self.on_pep_services_menuitem_activate, account)
|
||||
|
|
Loading…
Reference in New Issue