Skip to content

Commit

Permalink
Merge pull request #33 from Mooling0602/mdf
Browse files Browse the repository at this point in the history
Update to v2.5.2 with some error fixed.
  • Loading branch information
Mooling0602 authored Jan 1, 2025
2 parents a70a945 + cd4e969 commit c109fbe
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions config.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Ci configuration for GitHub Actions.
[framework]
ver=3
ver=1
[main]
ver=2.5.1
ver=2.5.2
[release]
test=0
[ci]
Expand Down
2 changes: 1 addition & 1 deletion matrix_sync/client/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async def message_callback(room: MatrixRoom, event: RoomMessageText) -> None:
room_info.id = room.room_id
room_info.display_name= room.display_name
if event.sender != plg_globals.config["user_id"]:
event_dispatcher(MatrixMessageEvent, event.body, room.user_name(event.sender), room)
event_dispatcher(MatrixMessageEvent, event.body, room.user_name(event.sender), room_info)

def on_sync_error(response: SyncError):
logger = get_logger()
Expand Down
4 changes: 2 additions & 2 deletions matrix_sync/event/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
def listen_message(server: PluginServerInterface):
server.register_event_listener("MatrixRoomMessage", on_matrix_message)

def on_matrix_message(server, message: str, sender: str, room):
def on_matrix_message(server, message: str, sender: str, room_info):
logger = get_logger()
if plg_globals.settings["listen"]["all_rooms"]:
message_format = plg_globals.settings["message_format"]["all_room"]
room_message = message_format.replace('%room_display_name%', room.display_name).replace('%sender%', sender).replace('%message%', message)
room_message = message_format.replace('%room_display_name%', room_info.display_name).replace('%sender%', sender).replace('%message%', message)
else:
message_format = plg_globals.settings["message_format"]["single_room"]
room_message = message_format.replace('%sender%', sender).replace('%message%', message)
Expand Down
3 changes: 3 additions & 0 deletions matrix_sync/logger/get_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ def warning(self, *args):
def error(self, *args):
psi.logger.error(args[0])

def debug(self, *args):
psi.logger.debug(args[0])

def get_logger():
if plg_globals.settings["log_style"]["mcdr"]:
logger = psiLogger()
Expand Down
2 changes: 1 addition & 1 deletion mcdreforged.plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "matrix_sync",
"version": "2.5.1",
"version": "2.5.2",
"name": "MatrixSync",
"description": {
"en_us": "Sync messages between online game and Matrix groups.",
Expand Down

0 comments on commit c109fbe

Please sign in to comment.