Add MUC Ad-Hoc instructions (Thank you roughnecks);

Fix automatic publishing mechanism by not excluding own JID;
Update index of commands and URLs.
This commit is contained in:
Schimon Jehudah, Adv. 2024-08-01 12:53:16 +03:00
parent ed7491b5a9
commit 3913f740ef
7 changed files with 78 additions and 12 deletions

View file

@ -245,7 +245,7 @@ and webhooks.
User XMPP client XMPP Server XMPP Bot REST API
"""]
interface = "Groupchat"
url = "https://github.com/nioc/xmpp-bot"
url = "https://git.xmpp-it.net/roughnecks/xmpp-bot"
[[legal]]
title = "Legal"

View file

@ -213,6 +213,18 @@ read <url> <index>
Display specified entry number from given <url> by given <index>.
"""
[pubsub]
pubsub = """
pubsub [off|on]
Designate JID as PubSub service.
"""
[send]
send = """
send <pubsub>/<jid> <url> <node>
Send feeds to given JID.
"""
[search]
feeds = """
feeds

View file

@ -3,7 +3,7 @@ info = """
Slixfeed is a news broker bot for syndicated news which aims to be \
an easy to use and fully-featured news aggregating bot.
Slixfeed provides a convenient access to Blogs, News sites and \
Slixfeed provides a convenient access to Blogs, News websites and \
even Fediverse instances, along with filtering and other privacy \
driven functionalities.

View file

@ -0,0 +1,56 @@
# Set Slixfeed Ad-Hoc Commands in MUC
This documents provides instructions for setting Slixfeed Ad-Hoc Commands on your XMPP server
These instruction are currently applied only to Prosody XMPP server.
We encourage to contribute instructions for other XMPP servers.
## Prosody
First of all install the relative Community Module:
```
$ sudo prosodyctl install --server=https://modules.prosody.im/rocks/ mod_muc_adhoc_bots
```
Then enable the module in your **MUC component** (`/etc/prosody/prosody.cfg.lua`), like this:
```
modules_enabled = {
"muc_mam",
"vcard_muc",
"muc_adhoc_bots",
"server_contact_info"
}
```
Last part is the bot's configuration, which goes again under the MUC component settings:
```
adhoc_bots = { "bot@jabber.i2p/slixfeed" }
```
Substitute `bot@jabber.i2p/slixfeed` with your bot JID and device name which has to correspond to `accounts.toml` settings for Slixfeed configuration:
```
[xmpp.client]
alias = "Slixfeed"
jid = "bot@jabber.i2p/slixfeed"
```
Reload the Prosody config and then load the module you just enabled under MUC component, or simply restart the XMPP server.
```
$ sudo prosodyctl shell
prosody> config:reload()
prosody> module:load('muc_adhoc_bots', "muc_component.jabber.i2p")
prosody> bye
```
Authors:
- Simone Canaletti (roughnecks)

View file

@ -1376,8 +1376,6 @@ class FeedTask:
def restart_task(self, jid_bare):
if jid_bare == self.boundjid.bare:
return
if jid_bare not in self.task_manager:
self.task_manager[jid_bare] = {}
logger.info('Creating new task manager for JID {}'.format(jid_bare))

View file

@ -1,2 +1,2 @@
__version__ = '0.1.93'
__version_info__ = (0, 1, 93)
__version__ = '0.1.94'
__version_info__ = (0, 1, 94)

View file

@ -463,7 +463,7 @@ class XmppClient(slixmpp.ClientXMPP):
logger.debug(message_log.format(function_name, jid_full))
# await task.check_readiness(self, presence)
jid_bare = presence['from'].bare
if jid_bare in self.boundjid.bare:
if jid_bare == self.boundjid.bare:
return
if presence['show'] in ('away', 'dnd', 'xa'):
if (jid_bare in self.task_manager and
@ -532,7 +532,7 @@ class XmppClient(slixmpp.ClientXMPP):
message_log = '{}: jid_full: {}'
logger.debug(message_log.format(function_name, jid_full))
jid_bare = presence['from'].bare
if jid_bare in self.boundjid.bare:
if jid_bare == self.boundjid.bare:
return
# FIXME TODO Find out what is the source responsible for a couple presences with empty message
# NOTE This is a temporary solution
@ -625,7 +625,7 @@ class XmppClient(slixmpp.ClientXMPP):
message_log = '{}: jid_full: {}'
logger.debug(message_log.format(function_name, jid_full))
jid_bare = message['from'].bare
if jid_bare in self.boundjid.bare:
if jid_bare == self.boundjid.bare:
return
if message['type'] in ('chat', 'normal'):
# NOTE: Required for Cheogram
@ -671,7 +671,7 @@ class XmppClient(slixmpp.ClientXMPP):
message_log = '{}: jid_full: {}'
logger.debug(message_log.format(function_name, jid_full))
jid_bare = message['from'].bare
if jid_bare in self.boundjid.bare:
if jid_bare == self.boundjid.bare:
return
if message['type'] in ('chat', 'normal'):
XmppStatusTask.restart_task(self, jid_bare)
@ -688,7 +688,7 @@ class XmppClient(slixmpp.ClientXMPP):
message_log = '{}: jid_full: {}'
logger.debug(message_log.format(function_name, jid_full))
jid_bare = message['from'].bare
if jid_bare in self.boundjid.bare:
if jid_bare == self.boundjid.bare:
return
if message['type'] in ('chat', 'normal'):
XmppStatusTask.restart_task(self, jid_bare)
@ -705,7 +705,7 @@ class XmppClient(slixmpp.ClientXMPP):
message_log = '{}: jid_full: {}'
logger.debug(message_log.format(function_name, jid_full))
jid_bare = message['from'].bare
if jid_bare in self.boundjid.bare:
if jid_bare == self.boundjid.bare:
return
if message['type'] in ('chat', 'normal'):
XmppStatusTask.restart_task(self, jid_bare)