Skip to content

Commit

Permalink
minor changes to allow sending files/images to unverified rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
8go committed Oct 21, 2024
1 parent 7707735 commit 5e5f169
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1944,7 +1944,7 @@ options:
the program will continue to run. This is useful for
having version number in the log files.
You are running version 7.7.0 2024-09-04. Enjoy, star on Github and contribute
You are running version 7.7.1 2024-10-21. Enjoy, star on Github and contribute
by submitting a Pull Request. Also have a look at matrix-commander-tui.
```

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.7.0
7.7.1
Binary file removed dist/matrix_commander-7.7.0-py3-none-any.whl
Binary file not shown.
Binary file removed dist/matrix_commander-7.7.0.tar.gz
Binary file not shown.
Binary file added dist/matrix_commander-7.7.1-py3-none-any.whl
Binary file not shown.
Binary file added dist/matrix_commander-7.7.1.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion help.help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,5 @@ delete-content ROOM_ID EVENT_ID REASON [ROOM_ID EVENT_ID REASON ...]
-v [PRINT|CHECK], -V [PRINT|CHECK], --version [PRINT|CHECK]
Print version information or check for updates.

You are running version 7.7.0 2024-09-04. Enjoy, star on Github and contribute
You are running version 7.7.1 2024-10-21. Enjoy, star on Github and contribute
by submitting a Pull Request. Also have a look at matrix-commander-tui.
2 changes: 1 addition & 1 deletion help.manual.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1184,5 +1184,5 @@ options:
the program will continue to run. This is useful for
having version number in the log files.

You are running version 7.7.0 2024-09-04. Enjoy, star on Github and contribute
You are running version 7.7.1 2024-10-21. Enjoy, star on Github and contribute
by submitting a Pull Request. Also have a look at matrix-commander-tui.
2 changes: 1 addition & 1 deletion help.usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ usage: matrix-commander [--usage] [-h] [--manual] [--readme] [-d]
[--room-invites [LIST|JOIN|LIST+JOIN]]
[-v [PRINT|CHECK]]

You are running version 7.7.0 2024-09-04. Enjoy, star on Github and contribute
You are running version 7.7.1 2024-10-21. Enjoy, star on Github and contribute
by submitting a Pull Request. Also have a look at matrix-commander-tui.
29 changes: 19 additions & 10 deletions matrix_commander/matrix_commander.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@
HAVE_OPENID = False

# version number
VERSION = "2024-09-04"
VERSIONNR = "7.7.0"
VERSION = "2024-10-21"
VERSIONNR = "7.7.1"
# matrix-commander; for backwards compitability replace _ with -
PROG_WITHOUT_EXT = os.path.splitext(os.path.basename(__file__))[0].replace(
"_", "-"
Expand Down Expand Up @@ -2967,7 +2967,10 @@ async def send_event(client, rooms, event): # noqa: C901
for room_id in rooms:
room_id = await map_roominfo_to_roomid(client, room_id)
resp = await client.room_send(
room_id, message_type=message_type, content=content
room_id,
message_type=message_type,
content=content,
ignore_unverified_devices=True,
)
if isinstance(resp, RoomSendError):
gs.log.error(
Expand Down Expand Up @@ -3139,8 +3142,8 @@ async def send_file(client, rooms, file): # noqa: C901
)
gs.log.info(
f'file="{file}"; mime_type="{mime_type}"; '
f'filessize="{file_stat.st_size}"'
f"Failed to upload: {privacy_filter(str(resp))}"
f'filessize="{file_stat.st_size}"; '
f"Failed to upload: Server response: {privacy_filter(str(resp))}"
)

# determine msg_type:
Expand Down Expand Up @@ -3172,7 +3175,10 @@ async def send_file(client, rooms, file): # noqa: C901
for room_id in rooms:
room_id = await map_roominfo_to_roomid(client, room_id)
resp = await client.room_send(
room_id, message_type="m.room.message", content=content
room_id,
message_type="m.room.message",
content=content,
ignore_unverified_devices=True,
)
if isinstance(resp, RoomSendError):
gs.log.error(
Expand Down Expand Up @@ -3386,8 +3392,8 @@ async def send_image(client, rooms, image): # noqa: C901
)
gs.log.info(
f'file="{image}"; mime_type="{mime_type}"; '
f'filessize="{file_stat.st_size}"'
f"Failed to upload: {privacy_filter(str(resp))}"
f'filessize="{file_stat.st_size}"; '
f"Failed to upload: Server response: {privacy_filter(str(resp))}"
)

# TODO compute thumbnail, upload thumbnail to Server
Expand Down Expand Up @@ -3423,7 +3429,10 @@ async def send_image(client, rooms, image): # noqa: C901
for room_id in rooms:
room_id = await map_roominfo_to_roomid(client, room_id)
resp = await client.room_send(
room_id, message_type="m.room.message", content=content
room_id,
message_type="m.room.message",
content=content,
ignore_unverified_devices=True,
)
if isinstance(resp, RoomSendError):
gs.log.error(
Expand Down Expand Up @@ -4687,7 +4696,7 @@ async def action_upload(client: AsyncClient, credentials: dict) -> None:
"E172: "
"Failed to upload. "
f'file="{filename}"; mime_type="{mime_type}"; '
f"filessize={file_stat.st_size}; encrypt={encrypt}"
f"filessize={file_stat.st_size}; encrypt={encrypt}; "
f"Server response: {privacy_filter(str(resp))}"
)
gs.err_count += 1
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://packaging.python.org/en/latest/tutorials/packaging-projects/
# https://setuptools.pypa.io/en/latest/userguide/
name = matrix-commander
version = 7.7.0
version = 7.7.1
author = 8go
description = A simple command-line Matrix client
long_description = file: PyPi-Instructions.md, README.md
Expand Down

0 comments on commit 5e5f169

Please sign in to comment.