From f11a461ad9f0b60775f0b2e4d044dee96d557c5e Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 2 Mar 2024 15:50:51 +0100 Subject: [PATCH] Remove unused Join callback --- src/matrix_rssbot/classes/bot.py | 2 +- src/matrix_rssbot/classes/callbacks/join.py | 20 -------------------- 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 src/matrix_rssbot/classes/callbacks/join.py diff --git a/src/matrix_rssbot/classes/bot.py b/src/matrix_rssbot/classes/bot.py index ff0f62e..590fa4a 100644 --- a/src/matrix_rssbot/classes/bot.py +++ b/src/matrix_rssbot/classes/bot.py @@ -320,7 +320,7 @@ class RSSBot: self.room_ignore_list.append(invite) else: - self.send_message(invite, "Thank you for inviting me to your room!") + await self.send_message(invite, "Thank you for inviting me to your room!") async def upload_file( self, diff --git a/src/matrix_rssbot/classes/callbacks/join.py b/src/matrix_rssbot/classes/callbacks/join.py deleted file mode 100644 index 46f0282..0000000 --- a/src/matrix_rssbot/classes/callbacks/join.py +++ /dev/null @@ -1,20 +0,0 @@ -from contextlib import closing - -async def join_callback(response, bot): - bot.logger.log( - f"Join response received for room {response.room_id}", "debug") - - bot.matrix_client.joined_rooms() - - with closing(bot.database.cursor()) as cursor: - cursor.execute( - "SELECT space_id FROM user_spaces WHERE user_id = ? AND active = TRUE", (event.sender,)) - space = cursor.fetchone() - - if space: - bot.logger.log(f"Adding new room to space {space[0]}...") - await bot.add_rooms_to_space(space[0], [new_room.room_id]) - - bot.matrix_client.keys_upload() - - await bot.send_message(bot.matrix_client.rooms[response.room_id], "Hello! Thanks for inviting me! How can I help you today?") \ No newline at end of file