You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could not find a solution in the documentation, the existing issues or discussions.
I already asked for help in the chat
In which Project did the bug appear?
Other
If you selected "Other" as Project, please enter in which project the bug occurred.
No response
On which platform did the bug appear?
Android, iOS
SDK Version
~0.37
Describe the problem caused by this bug
By looking at the source code, isDirectChat relies on directChatMatrixID. Inside directChatMatrixID block, it only sets value when membership == Membership.invite. It should cater the scenario for Membership.join which is majority of the cases. In another words, when membership is join, this value is incorrect when the room is actually a direct chat room.
String?get directChatMatrixID {
// Calculating the directChatMatrixId can be expensive. We cache it and// validate the cache instead every time.final cache = _cachedDirectChatMatrixId;
if (cache !=null) {
final roomIds = client.directChats[cache];
if (roomIds isList&& roomIds.contains(id)) {
return cache;
}
}
if (membership ==Membership.invite) {
final userID = client.userID;
if (userID ==null) returnnull;
final invitation =getState(EventTypes.RoomMember, userID);
if (invitation !=null&& invitation.content['is_direct'] ==true) {
return _cachedDirectChatMatrixId = invitation.senderId;
}
}
final mxId = client.directChats.entries
.firstWhereOrNull((MapEntry<String, dynamic> e) {
final roomIds = e.value;
return roomIds isList<dynamic> && roomIds.contains(id);
})?.key;
if (mxId?.isValidMatrixId ==true) return _cachedDirectChatMatrixId = mxId;
return _cachedDirectChatMatrixId =null;
}
/// Wheither this is a direct chat or notboolget isDirectChat => directChatMatrixID !=null;
Steps To Reproduce
No response
Screenshots or Logs
No response
Security related
No response
The text was updated successfully, but these errors were encountered:
Checklist
In which Project did the bug appear?
Other
If you selected "Other" as Project, please enter in which project the bug occurred.
No response
On which platform did the bug appear?
Android, iOS
SDK Version
~0.37
Describe the problem caused by this bug
By looking at the source code,
isDirectChat
relies ondirectChatMatrixID
. InsidedirectChatMatrixID
block, it only sets value whenmembership == Membership.invite
. It should cater the scenario forMembership.join
which is majority of the cases. In another words, when membership isjoin
, this value is incorrect when the room is actually a direct chat room.Steps To Reproduce
No response
Screenshots or Logs
No response
Security related
No response
The text was updated successfully, but these errors were encountered: