Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/cr/72
This commit is contained in:
commit
0a36af7cc0
118 changed files with 11130 additions and 9263 deletions
|
@ -1003,7 +1003,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
|
|||
|
||||
let avatar: JSX.Element | null = null;
|
||||
let sender: JSX.Element | null = null;
|
||||
let avatarSize: string;
|
||||
let avatarSize: string | null;
|
||||
let needsSenderProfile: boolean;
|
||||
|
||||
if (isRenderingNotification) {
|
||||
|
@ -1021,7 +1021,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
|
|||
avatarSize = "32px";
|
||||
needsSenderProfile = true;
|
||||
} else if (eventType === EventType.RoomCreate || isBubbleMessage) {
|
||||
avatarSize = "0";
|
||||
avatarSize = null;
|
||||
needsSenderProfile = false;
|
||||
} else if (this.props.layout == Layout.IRC) {
|
||||
avatarSize = "14px";
|
||||
|
@ -1032,14 +1032,14 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
|
|||
ElementCall.CALL_EVENT_TYPE.matches(eventType)
|
||||
) {
|
||||
// no avatar or sender profile for continuation messages and call tiles
|
||||
avatarSize = "0";
|
||||
avatarSize = null;
|
||||
needsSenderProfile = false;
|
||||
} else {
|
||||
avatarSize = "30px";
|
||||
needsSenderProfile = true;
|
||||
}
|
||||
|
||||
if (this.props.mxEvent.sender && avatarSize) {
|
||||
if (this.props.mxEvent.sender && avatarSize !== null) {
|
||||
let member: RoomMember | null = null;
|
||||
// set member to receiver (target) if it is a 3PID invite
|
||||
// so that the correct avatar is shown as the text is
|
||||
|
|
|
@ -112,7 +112,7 @@ export const RoomKnocksBar: VFC<{ room: Room }> = ({ room }) => {
|
|||
</>
|
||||
);
|
||||
names = `${knockMembers[0].name} (${knockMembers[0].userId})`;
|
||||
link = (
|
||||
link = knockMembers[0].events.member?.getContent().reason && (
|
||||
<AccessibleButton
|
||||
className="mx_RoomKnocksBar_link"
|
||||
element="a"
|
||||
|
|
|
@ -62,6 +62,7 @@ enum MessageCase {
|
|||
OtherError = "OtherError",
|
||||
PromptAskToJoin = "PromptAskToJoin",
|
||||
Knocked = "Knocked",
|
||||
RequestDenied = "requestDenied",
|
||||
}
|
||||
|
||||
interface IProps {
|
||||
|
@ -188,7 +189,11 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
const myMember = this.getMyMember();
|
||||
|
||||
if (myMember) {
|
||||
const previousMembership = myMember.events.member?.getPrevContent().membership;
|
||||
if (myMember.isKicked()) {
|
||||
if (previousMembership === "knock") {
|
||||
return MessageCase.RequestDenied;
|
||||
}
|
||||
return MessageCase.Kicked;
|
||||
} else if (myMember.membership === "ban") {
|
||||
return MessageCase.Banned;
|
||||
|
@ -397,6 +402,21 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case MessageCase.RequestDenied: {
|
||||
title = _t("You have been denied access");
|
||||
|
||||
subTitle = _t(
|
||||
"As you have been denied access, you cannot rejoin unless you are invited by the admin or moderator of the group.",
|
||||
);
|
||||
|
||||
if (isSpace) {
|
||||
primaryActionLabel = _t("Forget this space");
|
||||
} else {
|
||||
primaryActionLabel = _t("Forget this room");
|
||||
}
|
||||
primaryActionHandler = this.props.onForgetClick;
|
||||
break;
|
||||
}
|
||||
case MessageCase.Banned: {
|
||||
const { memberName, reason } = this.getKickOrBanInfo();
|
||||
if (roomName) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue