Skip to content

Commit

Permalink
Remove 'MessageSendToMatrix' event
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooling0602 committed Dec 22, 2024
1 parent 10e2d7e commit 168c853
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
2 changes: 0 additions & 2 deletions matrix_sync/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from .client import *
from .utils import tr
from .utils.logger import *
from .event import SendToMatrixEvent, event_dispatcher


builder = SimpleCommandBuilder()
Expand All @@ -34,7 +33,6 @@ async def add_sync_task():
@new_thread('MatrixReporter')
def matrix_reporter(message: str):
asyncio.run(add_report_task(message))
event_dispatcher(SendToMatrixEvent, user_id=plg_globals.config["user_id"], room_id=plg_globals.config["room_id"])

async def add_report_task(message: str):
report_task = asyncio.create_task(send_to_matrix(message))
Expand Down
6 changes: 0 additions & 6 deletions matrix_sync/event/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ def __init__(self, message: str, sender: str, room_id: str):
self.sender = sender
self.room_id = room_id

class SendToMatrixEvent(PluginEvent):
def __init__(self, user_id, room_id):
super().__init__('MessageSendToMatrix')
self.user_id = user_id
self.room_id = room_id

def event_dispatcher(event: type[PluginEvent], *args, **kwargs):
event_instance = event(*args, **kwargs)
psi.dispatch_event(event_instance, args)
Expand Down

0 comments on commit 168c853

Please sign in to comment.