Merge branch 'develop' into johannes/find-myself
This commit is contained in:
commit
c5fa3fc796
49 changed files with 1153 additions and 528 deletions
|
@ -139,6 +139,7 @@ import GenericToast from "../views/toasts/GenericToast";
|
|||
import RovingSpotlightDialog, { Filter } from "../views/dialogs/spotlight/SpotlightDialog";
|
||||
import { findDMForUser } from "../../utils/dm/findDMForUser";
|
||||
import { Linkify } from "../../HtmlUtils";
|
||||
import { NotificationColor } from "../../stores/notifications/NotificationColor";
|
||||
|
||||
// legacy export
|
||||
export { default as Views } from "../../Views";
|
||||
|
@ -1961,6 +1962,8 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
}
|
||||
if (numUnreadRooms > 0) {
|
||||
this.subTitleStatus += `[${numUnreadRooms}]`;
|
||||
} else if (notificationState.color >= NotificationColor.Bold) {
|
||||
this.subTitleStatus += `*`;
|
||||
}
|
||||
|
||||
this.setPageSubtitle();
|
||||
|
|
|
@ -192,10 +192,7 @@ class PipContainerInner extends React.Component<IProps, IState> {
|
|||
};
|
||||
|
||||
private onWidgetPersistence = (): void => {
|
||||
this.updateShowWidgetInPip(
|
||||
ActiveWidgetStore.instance.getPersistentWidgetId(),
|
||||
ActiveWidgetStore.instance.getPersistentRoomId(),
|
||||
);
|
||||
this.updateShowWidgetInPip();
|
||||
};
|
||||
|
||||
private onWidgetDockChanges = (): void => {
|
||||
|
@ -234,11 +231,10 @@ class PipContainerInner extends React.Component<IProps, IState> {
|
|||
}
|
||||
};
|
||||
|
||||
// Accepts a persistentWidgetId to be able to skip awaiting the setState for persistentWidgetId
|
||||
public updateShowWidgetInPip(
|
||||
persistentWidgetId = this.state.persistentWidgetId,
|
||||
persistentRoomId = this.state.persistentRoomId,
|
||||
): void {
|
||||
public updateShowWidgetInPip(): void {
|
||||
const persistentWidgetId = ActiveWidgetStore.instance.getPersistentWidgetId();
|
||||
const persistentRoomId = ActiveWidgetStore.instance.getPersistentRoomId();
|
||||
|
||||
let fromAnotherRoom = false;
|
||||
let notDocked = false;
|
||||
// Sanity check the room - the widget may have been destroyed between render cycles, and
|
||||
|
|
|
@ -48,7 +48,8 @@ export default class ServerOfflineDialog extends React.PureComponent<IProps> {
|
|||
private renderTimeline(): React.ReactElement[] {
|
||||
return EchoStore.instance.contexts.map((c, i) => {
|
||||
if (!c.firstFailedTime) return null; // not useful
|
||||
if (!(c instanceof RoomEchoContext)) throw new Error("Cannot render unknown context: " + c);
|
||||
if (!(c instanceof RoomEchoContext))
|
||||
throw new Error("Cannot render unknown context: " + c.constructor.name);
|
||||
const header = (
|
||||
<div className="mx_ServerOfflineDialog_content_context_timeline_header">
|
||||
<RoomAvatar width={24} height={24} room={c.room} />
|
||||
|
|
|
@ -507,39 +507,36 @@ export default class EventListSummary extends React.Component<IProps> {
|
|||
eventsToRender.forEach((e, index) => {
|
||||
const type = e.getType();
|
||||
|
||||
let userId = e.getSender();
|
||||
if (type === EventType.RoomMember) {
|
||||
userId = e.getStateKey();
|
||||
let userKey = e.getSender()!;
|
||||
if (type === EventType.RoomThirdPartyInvite) {
|
||||
userKey = e.getContent().display_name;
|
||||
} else if (type === EventType.RoomMember) {
|
||||
userKey = e.getStateKey();
|
||||
} else if (e.isRedacted()) {
|
||||
userId = e.getUnsigned()?.redacted_because?.sender;
|
||||
userKey = e.getUnsigned()?.redacted_because?.sender;
|
||||
}
|
||||
|
||||
// Initialise a user's events
|
||||
if (!userEvents[userId]) {
|
||||
userEvents[userId] = [];
|
||||
if (!userEvents[userKey]) {
|
||||
userEvents[userKey] = [];
|
||||
}
|
||||
|
||||
let displayName = userId;
|
||||
if (type === EventType.RoomThirdPartyInvite) {
|
||||
displayName = e.getContent().display_name;
|
||||
if (e.sender) {
|
||||
latestUserAvatarMember.set(userId, e.sender);
|
||||
}
|
||||
} else if (e.isRedacted()) {
|
||||
const sender = this.context?.room.getMember(userId);
|
||||
let displayName = userKey;
|
||||
if (e.isRedacted()) {
|
||||
const sender = this.context?.room?.getMember(userKey);
|
||||
if (sender) {
|
||||
displayName = sender.name;
|
||||
latestUserAvatarMember.set(userId, sender);
|
||||
latestUserAvatarMember.set(userKey, sender);
|
||||
}
|
||||
} else if (e.target && TARGET_AS_DISPLAY_NAME_EVENTS.includes(type as EventType)) {
|
||||
displayName = e.target.name;
|
||||
latestUserAvatarMember.set(userId, e.target);
|
||||
} else if (e.sender) {
|
||||
latestUserAvatarMember.set(userKey, e.target);
|
||||
} else if (e.sender && type !== EventType.RoomThirdPartyInvite) {
|
||||
displayName = e.sender.name;
|
||||
latestUserAvatarMember.set(userId, e.sender);
|
||||
latestUserAvatarMember.set(userKey, e.sender);
|
||||
}
|
||||
|
||||
userEvents[userId].push({
|
||||
userEvents[userKey].push({
|
||||
mxEvent: e,
|
||||
displayName,
|
||||
index: index,
|
||||
|
|
|
@ -185,6 +185,10 @@ export default class ProfileSettings extends React.Component<{}, IState> {
|
|||
withDisplayName: true,
|
||||
});
|
||||
|
||||
// False negative result from no-base-to-string rule, doesn't seem to account for Symbol.toStringTag
|
||||
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
||||
const avatarUrl = this.state.avatarUrl?.toString();
|
||||
|
||||
return (
|
||||
<form onSubmit={this.saveProfile} autoComplete="off" noValidate={true} className="mx_ProfileSettings">
|
||||
<input
|
||||
|
@ -216,7 +220,7 @@ export default class ProfileSettings extends React.Component<{}, IState> {
|
|||
</p>
|
||||
</div>
|
||||
<AvatarSetting
|
||||
avatarUrl={this.state.avatarUrl?.toString()}
|
||||
avatarUrl={avatarUrl}
|
||||
avatarName={this.state.displayName || this.state.userId}
|
||||
avatarAltText={_t("Profile picture")}
|
||||
uploadAvatar={this.uploadAvatar}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue