Skip to content

Commit 975e0d9

Browse files
committed
Make /status comply with the command args rule
- if there are more args than handled, no message will be set - fix the 'status' plugin accordingly
1 parent c3f822e commit 975e0d9

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

plugins/status.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ class Plugin(BasePlugin):
55
Adds several convenient aliases to /status command
66
"""
77
def init(self):
8-
self.add_command('dnd', lambda line: self.core.command_status('dnd '+line),
8+
self.add_command('dnd', lambda line: self.core.command_status('dnd "'+line+'"'),
99
'/dnd [status message]\nDnd: Set your status as dnd (do not disturb).')
10-
self.add_command('busy', lambda line: self.core.command_status('busy '+line),
10+
self.add_command('busy', lambda line: self.core.command_status('busy "'+line+'"'),
1111
'/busy [status message]\nBusy: Set your status as busy.')
12-
self.add_command('chat', lambda line: self.core.command_status('chat '+line),
12+
self.add_command('chat', lambda line: self.core.command_status('chat "'+line+'"'),
1313
'/chat [status message]\nChat: Set your status as chatty.')
14-
self.add_command('xa', lambda line: self.core.command_status('xa '+line),
14+
self.add_command('xa', lambda line: self.core.command_status('xa "'+line+'"'),
1515
'/xa [status message]\nXa: Set your status as xa (eXtended away).')
16-
self.add_command('afk', lambda line: self.core.command_status('afk '+line),
16+
self.add_command('afk', lambda line: self.core.command_status('afk "'+line+'"'),
1717
'/afk [status message]\nAfk: Set your status as afk (away from keyboard).')
18-
self.add_command('away', lambda line: self.core.command_status('away '+line),
18+
self.add_command('away', lambda line: self.core.command_status('away "'+line+'"'),
1919
'/away [status message]\nAway: Set your status as away.')
20-
self.add_command('available', lambda line: self.core.command_status('available '+line),
20+
self.add_command('available', lambda line: self.core.command_status('available "'+line+'"'),
2121
'/available [status message]\nAvailable: Set your status as available.')

src/core.py

-2
Original file line numberDiff line numberDiff line change
@@ -1551,8 +1551,6 @@ def command_status(self, arg):
15511551
show = possible_show[args[0]]
15521552
if len(args) == 2:
15531553
msg = args[1]
1554-
elif len(args) > 2:
1555-
msg = arg[len(args[0])+1:]
15561554
else:
15571555
msg = None
15581556
pres = self.xmpp.make_presence()

0 commit comments

Comments
 (0)