Skip to content

matrix: improve non-self member detection of a DM room for bridges#5

Merged
pawelb0 merged 1 commit into
pawelb0:mainfrom
vmiklos:improve-bridged-dms
Jun 4, 2026
Merged

matrix: improve non-self member detection of a DM room for bridges#5
pawelb0 merged 1 commit into
pawelb0:mainfrom
vmiklos:improve-bridged-dms

Conversation

@vmiklos

@vmiklos vmiklos commented May 29, 2026

Copy link
Copy Markdown
Contributor

Have a bridged DM (e.g. Signal DM) as a Matrix room, which technically has 4 nicks: an admin bot, the other person, your bridged equivalent and yourself. Reading messages was possible in this case (mapped to an IRC DM) but sending resulted in a ": No such nick/channel" error message.

It seems what happens is that dm_peer() used to find the bridged equivalent of "me" in such rooms as the "nick":
debug, register_dm: room.room_id() is '!...:vmiklos.hu', nick is 'vmiklos'

Fix the problem by taking a hint from the DM display name: if we find the user based on that (which is typical in such bridged rooms), then use that nick:
debug, register_dm: room.room_id() is '!...:vmiklos.hu', nick is 'othernick'

No test is added: dm_peer() currently takes a matrix SDK Client and Room as parameters, which are hard to construct in a testcase.

Have a bridged DM (e.g. Signal DM) as a Matrix room, which technically
has 4 nicks: an admin bot, the other person, your bridged equivalent and
yourself. Reading messages was possible in this case (mapped to an IRC
DM) but sending resulted in a "<other nick>: No such nick/channel" error
message.

It seems what happens is that dm_peer() used to find the bridged
equivalent of "me" in such rooms as the "nick":
debug, register_dm: room.room_id() is '!...:vmiklos.hu', nick is 'vmiklos'

Fix the problem by taking a hint from the DM display name: if we find
the user based on that (which is typical in such bridged rooms), then
use that nick:
debug, register_dm: room.room_id() is '!...:vmiklos.hu', nick is 'othernick'

No test is added: dm_peer() currently takes a matrix SDK Client and Room
as parameters, which are hard to construct in a testcase.
@vmiklos

vmiklos commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

Ah, I forgot to run 'cargo clippy', let me fix its warning.

@vmiklos vmiklos force-pushed the improve-bridged-dms branch from 1b07f3e to 2dbccf5 Compare May 29, 2026 21:03
@pawelb0 pawelb0 merged commit 091314f into pawelb0:main Jun 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants