Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into export-conversations

This commit is contained in:
Jaiwanth 2021-06-22 09:27:37 +05:30
commit 45be4a6d02
98 changed files with 1679 additions and 975 deletions

View file

@ -14,11 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import {MatrixClientPeg} from '../MatrixClientPeg';
import {uniq} from "lodash";
import {Room} from "matrix-js-sdk/src/models/room";
import {Event} from "matrix-js-sdk/src/models/event";
import {MatrixClient} from "matrix-js-sdk/src/client";
import { uniq } from "lodash";
import { Room } from "matrix-js-sdk/src/models/room";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { MatrixClientPeg } from '../MatrixClientPeg';
/**
* Class that takes a Matrix Client and flips the m.direct map
@ -30,15 +30,13 @@ import {MatrixClient} from "matrix-js-sdk/src/client";
export default class DMRoomMap {
private static sharedInstance: DMRoomMap;
private matrixClient: MatrixClient;
// TODO: convert these to maps
private roomToUser: {[key: string]: string} = null;
private userToRooms: {[key: string]: string[]} = null;
private hasSentOutPatchDirectAccountDataPatch: boolean;
private mDirectEvent: Event;
private mDirectEvent: object;
constructor(matrixClient) {
this.matrixClient = matrixClient;
constructor(private readonly matrixClient: MatrixClient) {
// see onAccountData
this.hasSentOutPatchDirectAccountDataPatch = false;

View file

@ -392,7 +392,7 @@ export default class WidgetUtils {
}
const widgets = client.getAccountData('m.widgets');
if (!widgets) return;
const userWidgets: IWidgetEvent[] = widgets.getContent() || {};
const userWidgets: Record<string, IWidgetEvent> = widgets.getContent() || {};
Object.entries(userWidgets).forEach(([key, widget]) => {
if (widget.content && widget.content.type === "m.integration_manager") {
delete userWidgets[key];