Skip to content

Commit

Permalink
fix(appservice): Make membership keys consistent
Browse files Browse the repository at this point in the history
Correct the inconsistency between the keys used for reading and writing
the membership of a virtual user in the appservice's namespace
  • Loading branch information
agraven authored and poljar committed Jun 8, 2022
1 parent 901b670 commit 5c4f2b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/matrix-sdk-appservice/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ impl AppService {
client
.store()
.set_custom_value(
&[USER_MEMBER, event.room_id().as_bytes(), localpart.as_bytes(), b"."].concat(),
&[USER_MEMBER, event.room_id().as_bytes(), b".", localpart.as_bytes()].concat(),
event.membership().to_string().into_bytes(),
)
.await?;
Expand All @@ -688,7 +688,7 @@ impl AppService {

let task = tokio::spawn(async move {
let user_id = match virt_client.user_id() {
Some(user_id) => user_id,
Some(user_id) => user_id.localpart(),
// Unauthenticated client. (should that be possible?)
None => return Ok(()),
};
Expand Down

0 comments on commit 5c4f2b3

Please sign in to comment.