disable DND when account if offline. Fixes #1754
This commit is contained in:
parent
c773f0966b
commit
4447ec9406
1 changed files with 8 additions and 6 deletions
|
@ -2989,6 +2989,11 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
iter_dest = model.get_iter(path_dest)
|
iter_dest = model.get_iter(path_dest)
|
||||||
type_dest = model[iter_dest][C_TYPE].decode('utf-8')
|
type_dest = model[iter_dest][C_TYPE].decode('utf-8')
|
||||||
jid_dest = model[iter_dest][C_JID].decode('utf-8')
|
jid_dest = model[iter_dest][C_JID].decode('utf-8')
|
||||||
|
account = model[iter_dest][C_ACCOUNT].decode('utf-8')
|
||||||
|
|
||||||
|
# if account is not connected, do nothing
|
||||||
|
if gajim.connections[account].connected < 2:
|
||||||
|
return
|
||||||
|
|
||||||
if info == self.TARGET_TYPE_URI_LIST:
|
if info == self.TARGET_TYPE_URI_LIST:
|
||||||
# User dropped a file on the roster
|
# User dropped a file on the roster
|
||||||
|
@ -2996,7 +3001,6 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
return
|
return
|
||||||
if type_dest != 'contact':
|
if type_dest != 'contact':
|
||||||
return
|
return
|
||||||
account = model[iter_dest][C_ACCOUNT].decode('utf-8')
|
|
||||||
c_dest = gajim.contacts.get_contact_with_highest_priority(account,
|
c_dest = gajim.contacts.get_contact_with_highest_priority(account,
|
||||||
jid_dest)
|
jid_dest)
|
||||||
uri = data.strip()
|
uri = data.strip()
|
||||||
|
@ -3018,10 +3022,8 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
return
|
return
|
||||||
if type_source != 'contact': # source is not a contact
|
if type_source != 'contact': # source is not a contact
|
||||||
return
|
return
|
||||||
account = model[iter_source][C_ACCOUNT].decode('utf-8')
|
source_account = model[iter_source][C_ACCOUNT].decode('utf-8')
|
||||||
if type_dest == 'contact':
|
if account != source_account: # dropped in another account
|
||||||
dest_account = model[iter_dest][C_ACCOUNT].decode('utf-8')
|
|
||||||
if account != dest_account: # dropped on a contact from another account
|
|
||||||
return
|
return
|
||||||
it = iter_source
|
it = iter_source
|
||||||
while model[it][C_TYPE] == 'contact':
|
while model[it][C_TYPE] == 'contact':
|
||||||
|
|
Loading…
Add table
Reference in a new issue