From 7ea48f4cdca57cda89121ab07eae39848ebebc60 Mon Sep 17 00:00:00 2001 From: Madhur Garg Date: Fri, 19 Jul 2019 23:34:46 +0530 Subject: Removed /mam command as it is implemented in mam_tab (WIP:37) --- poezio/tabs/basetabs.py | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'poezio/tabs') diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index ccd3a9d0..9ee71070 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -501,11 +501,6 @@ class ChatTab(Tab): self.command_scrollback, usage="end home clear status goto <+|-linecount>||", shortdesc='Scrollback to the given line number, message, or clear the buffer.') - self.register_command( - 'mam', - self.command_mam, - usage="[start_timestamp [end_timestamp]]", - shortdesc='Query an archive of messages using MAM.') self.commands['sb'] = self.commands['scrollback'] self.register_command( 'xhtml', @@ -925,34 +920,6 @@ class ChatTab(Tab): # new_date is the timestamp for which the user has queried. self.goto_build_lines(new_date) - @command_args_parser.quoted(0, 2) - def command_mam(self, args): - """ - Query an archive of messages using MAM. - /mam [start_timestamp [end_timestamp]] - """ - - remote_jid = self.jid - top = False - end = datetime.now() - end = datetime.strftime(end, '%Y-%m-%dT%H:%M:%SZ') - start = datetime.strptime(end, '%Y-%m-%dT%H:%M:%SZ') - # Default start date is 10 days past the current day. - start = start + timedelta(days=-10) - start = datetime.strftime(start, '%Y-%m-%dT%H:%M:%SZ') - # Format for start and end timestamp is [dd:mm:yyyy] - if len(args) >= 1: - try: - start = datetime.strptime(args[0], '%d:%m:%Y') - start = datetime.strftime(start, '%Y-%m-%dT%H:%M:%SZ') - if len(args) == 2: - end = datetime.strptime(args[1], '%d:%m:%Y') - end = datetime.strftime(end, '%Y-%m-%dT%H:%M:%SZ') - except ValueError: - self.core.information("Please enter a valid JID in [dd:mm:yyyy] format.", "Error") - - asyncio.ensure_future(mam.query(self, remote_jid, start, end, top)) - def on_line_up(self): return self.text_win.scroll_up(1) -- cgit v1.2.3