From 56f85fdf26231cbefe7fd983ae9867ed5b02884b Mon Sep 17 00:00:00 2001 From: Schimon Jehudah Date: Fri, 23 Feb 2024 14:54:54 +0000 Subject: [PATCH] Add command version. Invite to groupchat upon command support. --- slixfeed/version.py | 4 ++-- slixfeed/xmpp/process.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/slixfeed/version.py b/slixfeed/version.py index b60097c..3a66ae4 100644 --- a/slixfeed/version.py +++ b/slixfeed/version.py @@ -1,2 +1,2 @@ -__version__ = '0.1.19' -__version_info__ = (0, 1, 19) +__version__ = '0.1.20' +__version_info__ = (0, 1, 20) diff --git a/slixfeed/xmpp/process.py b/slixfeed/xmpp/process.py index 7bd9e80..7df5801 100644 --- a/slixfeed/xmpp/process.py +++ b/slixfeed/xmpp/process.py @@ -33,6 +33,7 @@ import slixfeed.fetch as fetch import slixfeed.sqlite as sqlite import slixfeed.task as task import slixfeed.url as uri +from slixfeed.version import __version__ from slixfeed.xmpp.bookmark import XmppBookmark from slixfeed.xmpp.muc import XmppGroupchat from slixfeed.xmpp.message import XmppMessage @@ -1097,8 +1098,13 @@ async def message(self, message): response = 'Updates are disabled.' XmppMessage.send_reply(self, message, response) case 'support': - # TODO Send an invitation. - response = 'Join xmpp:slixfeed@chat.woodpeckersnest.space?join' + muc_jid = 'slixfeed@chat.woodpeckersnest.space' + response = 'Join xmpp:{}?join'.format(muc_jid) + XmppMessage.send_reply(self, message, response) + if await get_chat_type(self, jid) == 'chat': + self.plugin['xep_0045'].invite(muc_jid, jid) + case 'version': + response = __version__ XmppMessage.send_reply(self, message, response) case _ if message_lowercase.startswith('xmpp:'): muc_jid = uri.check_xmpp_uri(message_text)