Philipp Hörist pushed to branch master at gajim / gajim
Commits:
cb4a2ed5 by Daniel Brötzmann at 2020-07-06T09:06:31+02:00
Roster: Add spam reporting
- - - - -
1 changed file:
- gajim/roster_window.py
Changes:
=====================================
gajim/roster_window.py
=====================================
@@ -2740,10 +2740,12 @@ class RosterWindow:
When clicked on the 'block' button in context menu. list_ is a list of
(contact, account)
"""
- def on_continue(msg, pep_dict):
- if msg is None:
- # user pressed Cancel to change status message dialog
- return
+ def _block_it(is_checked=None, report=None):
+ if is_checked is not None: # Dialog has been shown
+ if is_checked:
+ app.config.set('confirm_block', 'no')
+ else:
+ app.config.set('confirm_block', 'yes')
accounts = []
for _, account in list_:
@@ -2755,7 +2757,7 @@ class RosterWindow:
l_ = [i[0] for i in list_ if i[1] == acct]
con = app.connections[acct]
jid_list = [contact.jid for contact in l_]
- con.get_module('Blocking').block(jid_list)
+ con.get_module('Blocking').block(jid_list, report)
for contact in l_:
ctrl = app.interface.msg_win_mgr.get_control(
contact.jid, acct)
@@ -2768,14 +2770,6 @@ class RosterWindow:
return
self.draw_contact(contact.jid, acct)
- def _block_it(is_checked=None):
- if is_checked is not None: # Dialog has been shown
- if is_checked:
- app.config.set('confirm_block', 'no')
- else:
- app.config.set('confirm_block', 'yes')
- self.get_status_message('offline', on_continue, show_pep=False)
-
# Check if confirmation is needed for blocking
confirm_block = app.config.get('confirm_block')
if confirm_block == 'no':
@@ -2789,6 +2783,10 @@ class RosterWindow:
'will not receive further messages.'),
_('_Do not ask again'),
[DialogButton.make('Cancel'),
+ DialogButton.make('OK',
+ text=_('_Report Spam'),
+ callback=_block_it,
+ kwargs={'report': 'spam'}),
DialogButton.make('Remove',
text=_('_Block'),
callback=_block_it)],
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/cb4a2ed5ecac6df95c27ae21d14ad385fee7ace0
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/cb4a2ed5ecac6df95c27ae21d14ad385fee7ace0
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits