unsafeGetUserFromMemoryOrFallback method

User unsafeGetUserFromMemoryOrFallback(
  1. String mxID
)

Returns the User object for the given mxID or return a fallback User and start a request to get the user from the node.

Implementation

User unsafeGetUserFromMemoryOrFallback(String mxID) {
  final user = getState(EventTypes.RoomMember, mxID);
  if (user != null) {
    return user.asUser;
  } else {
    if (mxID.isValidSDNId) {
      requestUser(
        mxID,
        ignoreErrors: true,
        requestProfile: false,
      );
    }
    return User(mxID, room: this);
  }
}