This commit is contained in:
2025-04-23 08:10:40 +00:00
parent b774e0d04c
commit ad4ec4d3a9
13 changed files with 57 additions and 19 deletions

View File

@@ -86,16 +86,7 @@ class PluginManager:
room.send_text(reply)
def is_sender_admin(self, event):
return False
"""Checks if author is admin"""
if message['type'] == 'groupchat':
# We don't know the jid. Either there's a problem or it's an anonymous room
if message['from'].full not in self.bot.presences:
return False
jid = self.bot.presences[message['from'].full]
else:
jid = message['from'].full.split('/')[0]
return jid in self.config.ADMINS
return event['sender'] in self.config.ADMINS
def is_admin_command(self, command):
return command in self.commands and self.commands[command]['options'].get('admin', False)