Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to v2.5.2 with some error fixed. #33

Merged
merged 1 commit into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading