remove the contact_mutual_removal advanced option and add a checkbutton in remove_contact dialog to ask if we want to remove both subscriptions
This commit is contained in:
parent
41fd150b93
commit
42ffc5d810
|
@ -38,7 +38,6 @@ class Config:
|
||||||
__options = {
|
__options = {
|
||||||
# name: [ type, value ]
|
# name: [ type, value ]
|
||||||
'verbose': [ opt_bool, False ],
|
'verbose': [ opt_bool, False ],
|
||||||
'contact_mutual_removal': [ opt_bool, True, _('When we remove a contact, remove both his and our subscription, so we do not receive his presence anymore and he ours.')],
|
|
||||||
'alwaysauth': [ opt_bool, False ],
|
'alwaysauth': [ opt_bool, False ],
|
||||||
'autopopup': [ opt_bool, False ],
|
'autopopup': [ opt_bool, False ],
|
||||||
'notify_on_signin': [ opt_bool, True ],
|
'notify_on_signin': [ opt_bool, True ],
|
||||||
|
|
|
@ -1710,10 +1710,10 @@ class Connection:
|
||||||
p = self.add_sha(p)
|
p = self.add_sha(p)
|
||||||
self.to_be_sent.append(p)
|
self.to_be_sent.append(p)
|
||||||
|
|
||||||
def unsubscribe(self, jid):
|
def unsubscribe(self, jid, remove_auth = True):
|
||||||
if not self.connection:
|
if not self.connection:
|
||||||
return
|
return
|
||||||
if gajim.config.get('contact_mutual_removal'):
|
if remove_auth:
|
||||||
self.connection.getRoster().delItem(jid)
|
self.connection.getRoster().delItem(jid)
|
||||||
else:
|
else:
|
||||||
self.connection.getRoster().Unsubscribe(jid)
|
self.connection.getRoster().Unsubscribe(jid)
|
||||||
|
|
|
@ -1216,11 +1216,15 @@ _('If "%s" accepts this request you will know his status.') %jid)
|
||||||
|
|
||||||
def on_req_usub(self, widget, user, account):
|
def on_req_usub(self, widget, user, account):
|
||||||
'''Remove a user'''
|
'''Remove a user'''
|
||||||
window = dialogs.ConfirmationDialog(\
|
window = dialogs.ConfirmationDialogCheck(\
|
||||||
_('Contact "%s" will be removed from your roster') % (user.name),
|
_('Contact "%s" will be removed from your roster') % (user.name),
|
||||||
_('By removing this contact you also remove authorization. Contact "%s" will always see you as offline.') % user.name)
|
_('By removing this contact you also remove authorization. Contact "%s" will always see you as offline.') % user.name,
|
||||||
|
_('Allow my contact to still know my status'))
|
||||||
if window.get_response() == gtk.RESPONSE_OK:
|
if window.get_response() == gtk.RESPONSE_OK:
|
||||||
gajim.connections[account].unsubscribe(user.jid)
|
remove_auth = True
|
||||||
|
if window.is_checked():
|
||||||
|
remove_auth = False
|
||||||
|
gajim.connections[account].unsubscribe(user.jid, remove_auth)
|
||||||
for u in gajim.contacts[account][user.jid]:
|
for u in gajim.contacts[account][user.jid]:
|
||||||
self.remove_contact(u, account)
|
self.remove_contact(u, account)
|
||||||
del gajim.contacts[account][u.jid]
|
del gajim.contacts[account][u.jid]
|
||||||
|
|
Loading…
Reference in New Issue