http://python.org/dev/peps/pep-0008/ " Comparisons to singletons like None should always be done with
'is' or 'is not', never the equality operators." Apply do roster_window. See r9488.
This commit is contained in:
parent
e504cee6fb
commit
f877fbea13
|
@ -641,7 +641,7 @@ class RosterWindow:
|
||||||
Return the added contact instance.
|
Return the added contact instance.
|
||||||
'''
|
'''
|
||||||
contact = gajim.contacts.get_contact_with_highest_priority(account, jid)
|
contact = gajim.contacts.get_contact_with_highest_priority(account, jid)
|
||||||
if contact == None:
|
if contact is None:
|
||||||
contact = gajim.contacts.create_contact(jid = jid, name = jid,
|
contact = gajim.contacts.create_contact(jid = jid, name = jid,
|
||||||
groups = [_('Groupchats')], show = 'online',
|
groups = [_('Groupchats')], show = 'online',
|
||||||
status = status, sub = 'none',
|
status = status, sub = 'none',
|
||||||
|
@ -2331,7 +2331,7 @@ class RosterWindow:
|
||||||
model = self.tree.get_model()
|
model = self.tree.get_model()
|
||||||
accounts = []
|
accounts = []
|
||||||
msg = self.get_status_message('offline')
|
msg = self.get_status_message('offline')
|
||||||
if group_list == None:
|
if group_list is None:
|
||||||
jid = model[iter][C_JID].decode('utf-8')
|
jid = model[iter][C_JID].decode('utf-8')
|
||||||
account = model[iter][C_ACCOUNT].decode('utf-8')
|
account = model[iter][C_ACCOUNT].decode('utf-8')
|
||||||
accounts.append(account)
|
accounts.append(account)
|
||||||
|
@ -2343,7 +2343,7 @@ class RosterWindow:
|
||||||
gajim.connections[account].blocked_contacts.append(jid)
|
gajim.connections[account].blocked_contacts.append(jid)
|
||||||
self.draw_contact(jid, account)
|
self.draw_contact(jid, account)
|
||||||
else:
|
else:
|
||||||
if iter == None:
|
if iter is None:
|
||||||
for (contact, account) in group_list:
|
for (contact, account) in group_list:
|
||||||
if account not in accounts:
|
if account not in accounts:
|
||||||
if not gajim.connections[account].privacy_rules_supported:
|
if not gajim.connections[account].privacy_rules_supported:
|
||||||
|
@ -2384,7 +2384,7 @@ class RosterWindow:
|
||||||
''' When clicked on the 'unblock' button in context menu. '''
|
''' When clicked on the 'unblock' button in context menu. '''
|
||||||
model = self.tree.get_model()
|
model = self.tree.get_model()
|
||||||
accounts = []
|
accounts = []
|
||||||
if group_list == None:
|
if group_list is None:
|
||||||
jid = model[iter][C_JID].decode('utf-8')
|
jid = model[iter][C_JID].decode('utf-8')
|
||||||
jid_account = model[iter][C_ACCOUNT].decode('utf-8')
|
jid_account = model[iter][C_ACCOUNT].decode('utf-8')
|
||||||
accounts.append(jid_account)
|
accounts.append(jid_account)
|
||||||
|
@ -2398,7 +2398,7 @@ class RosterWindow:
|
||||||
gajim.connections[jid_account].blocked_contacts.remove(jid)
|
gajim.connections[jid_account].blocked_contacts.remove(jid)
|
||||||
self.draw_contact(jid, jid_account)
|
self.draw_contact(jid, jid_account)
|
||||||
else:
|
else:
|
||||||
if iter == None:
|
if iter is None:
|
||||||
for (contact, account) in group_list:
|
for (contact, account) in group_list:
|
||||||
if account not in accounts:
|
if account not in accounts:
|
||||||
if gajim.connections[account].privacy_rules_supported:
|
if gajim.connections[account].privacy_rules_supported:
|
||||||
|
@ -2449,7 +2449,7 @@ class RosterWindow:
|
||||||
if gajim.interface.instances[account].has_key('blocked_contacts'):
|
if gajim.interface.instances[account].has_key('blocked_contacts'):
|
||||||
gajim.interface.instances[account]['blocked_contacts'].\
|
gajim.interface.instances[account]['blocked_contacts'].\
|
||||||
privacy_list_received([])
|
privacy_list_received([])
|
||||||
if group_list == None:
|
if group_list is None:
|
||||||
status = gajim.connections[jid_account].connected
|
status = gajim.connections[jid_account].connected
|
||||||
msg = gajim.connections[jid_account].status
|
msg = gajim.connections[jid_account].status
|
||||||
if not self.regroup:
|
if not self.regroup:
|
||||||
|
@ -3511,7 +3511,7 @@ class RosterWindow:
|
||||||
'So those information will not be saved on next reconnection.'))
|
'So those information will not be saved on next reconnection.'))
|
||||||
|
|
||||||
def merge_contacts(is_checked=None):
|
def merge_contacts(is_checked=None):
|
||||||
if is_checked != None: # dialog has been shown
|
if is_checked is not None: # dialog has been shown
|
||||||
if is_checked: # user does not want to be asked again
|
if is_checked: # user does not want to be asked again
|
||||||
gajim.config.set('confirm_metacontacts', 'no')
|
gajim.config.set('confirm_metacontacts', 'no')
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue