Philipp Hörist pushed to branch master at gajim / gajim
Commits: 318001e5 by lovetox at 2022-02-02T22:53:40+01:00 Remove support for server announce The functionality is available via adhoc commands - - - - - 3 changed files: - − gajim/common/modules/announce.py - gajim/gtk/application.py - gajim/gtk/menus.py Changes: ===================================== gajim/common/modules/announce.py deleted ===================================== @@ -1,33 +0,0 @@ -# This file is part of Gajim. -# -# Gajim is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published -# by the Free Software Foundation; version 3 only. -# -# Gajim is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Gajim. If not, see <http://www.gnu.org/licenses/>. - -# Server MOTD and Announce - -import nbxmpp - -from gajim.common.modules.base import BaseModule - - -class Announce(BaseModule): - def __init__(self, con): - BaseModule.__init__(self, con) - - def delete_motd(self): - server = self._con.get_own_jid().domain - jid = '%s/announce/motd/delete' % server - self.set_announce(jid) - - def set_announce(self, jid, subject=None, body=None): - message = nbxmpp.Message(to=jid, body=body, subject=subject) - self._nbxmpp().send(message) ===================================== gajim/gtk/application.py ===================================== @@ -445,10 +445,6 @@ def _get_account_actions(self, ('-pep-config', self._on_pep_config_action, 'online', 's'), ('-sync-history', self._on_sync_history_action, 'online', 's'), ('-blocking', self._on_blocking_action, 'feature', 's'), - ('-send-server-message', self._on_send_server_message_action, 'online', 's'), - ('-set-motd', self._on_set_motd_action, 'online', 's'), - ('-update-motd', self._on_update_motd_action, 'online', 's'), - ('-delete-motd', self._on_delete_motd_action, 'online', 's'), ('-open-event', self._on_open_event_action, 'always', 'a{sv}'), ('-mark-as-read', self._on_mark_as_read_action, 'always', 'a{sv}'), ('-import-contacts', self._on_import_contacts_action, 'online', 's'), @@ -577,14 +573,6 @@ def _on_profile_action(_action: Gio.SimpleAction, account = param.get_string() open_window('ProfileWindow', account=account) - @staticmethod - def _on_send_server_message_action(_action: Gio.SimpleAction, - param: GLib.Variant) -> None: - account = param.get_string() - server = app.settings.get_account_setting(account, 'hostname') - server += '/announce/online' - open_window('SingleMessageWindow', account=account, recipients=server) - @staticmethod def _on_services_action(_action: Gio.SimpleAction, param: GLib.Variant) -> None: @@ -676,28 +664,6 @@ def _on_manage_proxies_action(_action: Gio.SimpleAction, _param: Optional[GLib.Variant]) -> None: open_window('ManageProxies') - @staticmethod - def _on_set_motd_action(_action: Gio.SimpleAction, - param: GLib.Variant) -> None: - account = param.get_string() - server = app.settings.get_account_setting(account, 'hostname') - server += '/announce/motd' - open_window('SingleMessageWindow', account=account, recipients=server) - - @staticmethod - def _on_update_motd_action(_action: Gio.SimpleAction, - param: GLib.Variant) -> None: - account = param.get_string() - server = app.settings.get_account_setting(account, 'hostname') - server += '/announce/motd/update' - open_window('SingleMessageWindow', account=account, recipients=server) - - @staticmethod - def _on_delete_motd_action(_action: Gio.SimpleAction, - param: GLib.Variant) -> None: - account = param.get_string() - app.connections[account].get_module('Announce').delete_motd() - @staticmethod def _on_content_action(_action: Gio.SimpleAction, _param: Optional[GLib.Variant]) -> None: ===================================== gajim/gtk/menus.py ===================================== @@ -191,15 +191,6 @@ def get_account_menu(account: str) -> Gio.Menu: menu.append_submenu(_('Advanced'), make_menu(advanced_menuitems)) - admin_menuitems: MenuItemListT = [ - (_('Send Server Message…'), f'app.{account}-send-server-message', val), - (_('Set MOTD…'), f'app.{account}-set-motd', val), - (_('Update MOTD…'), f'app.{account}-update-motd', val), - (_('Delete MOTD…'), f'app.{account}-delete-motd', val) - ] - - menu.append_submenu(_('Admin'), make_menu(admin_menuitems)) - return menu View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/318001e558b14863e0ce7ca2298fcc853d2fbba6 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/318001e558b14863e0ce7ca2298fcc853d2fbba6 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
