matrix: improve non-self member detection of a DM room for bridges#5
Merged
Conversation
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.
Contributor
Author
|
Ah, I forgot to run 'cargo clippy', let me fix its warning. |
1b07f3e to
2dbccf5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.