summaryrefslogtreecommitdiff
path: root/poezio/core/commands.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/commands.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/commands.py')
-rw-r--r--poezio/core/commands.py72
1 files changed, 0 insertions, 72 deletions
diff --git a/poezio/core/commands.py b/poezio/core/commands.py
index 964bd0a7..ebd8f130 100644
--- a/poezio/core/commands.py
+++ b/poezio/core/commands.py
@@ -15,7 +15,6 @@ from slixmpp.xmlstream.handler import Callback
from slixmpp.xmlstream.matcher import StanzaPath
from poezio import common
-from poezio import pep
from poezio import tabs
from poezio import multiuserchat as muc
from poezio.bookmarks import Bookmark
@@ -938,71 +937,6 @@ class CommandCore:
if status else '')
self.core.information(msg, 'Info')
- @command_args_parser.quoted(0, 2)
- def mood(self, args):
- """
- /mood [<mood> [text]]
- """
- if not args:
- return self.core.xmpp.plugin['xep_0107'].stop()
-
- mood = args[0]
- if mood not in pep.MOODS:
- return self.core.information(
- '%s is not a correct value for a mood.' % mood, 'Error')
- if len(args) == 2:
- text = args[1]
- else:
- text = None
- self.core.xmpp.plugin['xep_0107'].publish_mood(
- mood, text, callback=dumb_callback)
-
- @command_args_parser.quoted(0, 3)
- def activity(self, args):
- """
- /activity [<general> [specific] [text]]
- """
- length = len(args)
- if not length:
- return self.core.xmpp.plugin['xep_0108'].stop()
-
- general = args[0]
- if general not in pep.ACTIVITIES:
- return self.core.information(
- '%s is not a correct value for an activity' % general, 'Error')
- specific = None
- text = None
- if length == 2:
- if args[1] in pep.ACTIVITIES[general]:
- specific = args[1]
- else:
- text = args[1]
- elif length == 3:
- specific = args[1]
- text = args[2]
- if specific and specific not in pep.ACTIVITIES[general]:
- return self.core.information(
- '%s is not a correct value '
- 'for an activity' % specific, 'Error')
- self.core.xmpp.plugin['xep_0108'].publish_activity(
- general, specific, text, callback=dumb_callback)
-
- @command_args_parser.quoted(0, 2)
- def gaming(self, args):
- """
- /gaming [<game name> [server address]]
- """
- if not args:
- return self.core.xmpp.plugin['xep_0196'].stop()
-
- name = args[0]
- if len(args) > 1:
- address = args[1]
- else:
- address = None
- return self.core.xmpp.plugin['xep_0196'].publish_gaming(
- name=name, server_address=address, callback=dumb_callback)
-
@command_args_parser.quoted(2, 1, [None])
async def invite(self, args):
"""/invite <to> <room> [reason]"""
@@ -1200,12 +1134,6 @@ class CommandCore:
return
msg = args[0]
- if config.get('enable_user_mood'):
- self.core.xmpp.plugin['xep_0107'].stop()
- if config.get('enable_user_activity'):
- self.core.xmpp.plugin['xep_0108'].stop()
- if config.get('enable_user_gaming'):
- self.core.xmpp.plugin['xep_0196'].stop()
self.core.save_config()
self.core.plugin_manager.disable_plugins()
self.core.xmpp.add_event_handler(