summaryrefslogtreecommitdiff
path: root/poezio/core/core.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-02-03 21:04:36 +0100
committermathieui <mathieui@mathieui.net>2021-02-09 19:16:03 +0100
commit2cfe56bbbe47c9bf8aa87c48324091e90623d43f (patch)
tree59a426fb8535c76d6a23bff2801849328effa6f2 /poezio/core/core.py
parentae0888bd3d6892f3da3ff0d7c3cbb60f61653f6c (diff)
downloadpoezio-2cfe56bbbe47c9bf8aa87c48324091e90623d43f.tar.gz
poezio-2cfe56bbbe47c9bf8aa87c48324091e90623d43f.tar.bz2
poezio-2cfe56bbbe47c9bf8aa87c48324091e90623d43f.tar.xz
poezio-2cfe56bbbe47c9bf8aa87c48324091e90623d43f.zip
Remove activity/mood/gaming/tune from poezio core
rationale: probably 0.1% of poezio users have ever used the commands, and a very small number of users are using the PEP events like that. It is better to unclutter the poezio source and add it as a plugin, with less tight coupling.
Diffstat (limited to 'poezio/core/core.py')
-rw-r--r--poezio/core/core.py50
1 files changed, 0 insertions, 50 deletions
diff --git a/poezio/core/core.py b/poezio/core/core.py
index 703319c5..efab8810 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -297,22 +297,9 @@ class Core:
self.handler.on_vcard_avatar)
self.xmpp.add_event_handler("avatar_metadata_publish",
self.handler.on_0084_avatar)
- if config.get('enable_user_tune'):
- self.xmpp.add_event_handler("user_tune_publish",
- self.handler.on_tune_event)
if config.get('enable_user_nick'):
self.xmpp.add_event_handler("user_nick_publish",
self.handler.on_nick_received)
- if config.get('enable_user_mood'):
- self.xmpp.add_event_handler("user_mood_publish",
- self.handler.on_mood_event)
- if config.get('enable_user_activity'):
- self.xmpp.add_event_handler("user_activity_publish",
- self.handler.on_activity_event)
- if config.get('enable_user_gaming'):
- self.xmpp.add_event_handler("user_gaming_publish",
- self.handler.on_gaming_event)
-
all_stanzas = Callback('custom matcher', connection.MatchAll(None),
self.handler.incoming_stanza)
self.xmpp.register_handler(all_stanzas)
@@ -525,12 +512,6 @@ class Core:
}
log.error("%s received. Exiting…", signals[sig])
- if config.get('enable_user_mood'):
- self.xmpp.plugin['xep_0107'].stop()
- if config.get('enable_user_activity'):
- self.xmpp.plugin['xep_0108'].stop()
- if config.get('enable_user_gaming'):
- self.xmpp.plugin['xep_0196'].stop()
self.plugin_manager.disable_plugins()
self.disconnect('%s received' % signals.get(sig))
self.xmpp.add_event_handler("disconnected", self.exit, disposable=True)
@@ -1693,37 +1674,6 @@ class Core:
for command in get_commands(self.command, self.completion, self.plugin_manager):
self.register_command(**command)
- if config.get('enable_user_activity'):
- self.register_command(
- 'activity',
- self.command.activity,
- usage='[<general> [specific] [text]]',
- desc='Send your current activity to your contacts '
- '(use the completion). Nothing means '
- '"stop broadcasting an activity".',
- shortdesc='Send your activity.',
- completion=self.completion.activity)
- if config.get('enable_user_mood'):
- self.register_command(
- 'mood',
- self.command.mood,
- usage='[<mood> [text]]',
- desc='Send your current mood to your contacts '
- '(use the completion). Nothing means '
- '"stop broadcasting a mood".',
- shortdesc='Send your mood.',
- completion=self.completion.mood)
- if config.get('enable_user_gaming'):
- self.register_command(
- 'gaming',
- self.command.gaming,
- usage='[<game name> [server address]]',
- desc='Send your current gaming activity to '
- 'your contacts. Nothing means "stop '
- 'broadcasting a gaming activity".',
- shortdesc='Send your gaming activity.',
- completion=None)
-
def check_blocking(self, features: List[str]):
if 'urn:xmpp:blocking' in features and not self.xmpp.anon:
self.register_command(