Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Remove deprecated m.room.aliases references (#9431)
Browse files Browse the repository at this point in the history
* Remove deprecated `m.room.aliases` references

* Update SlashCommands.tsx
  • Loading branch information
t3chguy authored Oct 17, 2022
1 parent 2d9f828 commit 6009d1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
17 changes: 6 additions & 11 deletions src/SlashCommands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ export const Commands = [
runFn: function(roomId, args) {
const cli = MatrixClientPeg.get();

let targetRoomId;
let targetRoomId: string;
if (args) {
const matches = args.match(/^(\S+)$/);
if (matches) {
Expand All @@ -725,16 +725,11 @@ export const Commands = [
// Try to find a room with this alias
const rooms = cli.getRooms();
for (let i = 0; i < rooms.length; i++) {
const aliasEvents = rooms[i].currentState.getStateEvents('m.room.aliases');
for (let j = 0; j < aliasEvents.length; j++) {
const aliases = aliasEvents[j].getContent().aliases || [];
for (let k = 0; k < aliases.length; k++) {
if (aliases[k] === roomAlias) {
targetRoomId = rooms[i].roomId;
break;
}
}
if (targetRoomId) break;
if (rooms[i].getCanonicalAlias() === roomAlias ||
rooms[i].getAltAliases().includes(roomAlias)
) {
targetRoomId = rooms[i].roomId;
break;
}
if (targetRoomId) break;
}
Expand Down
1 change: 0 additions & 1 deletion src/Unread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export function eventTriggersUnreadCount(ev: MatrixEvent): boolean {
case EventType.RoomThirdPartyInvite:
case EventType.CallAnswer:
case EventType.CallHangup:
case EventType.RoomAliases:
case EventType.RoomCanonicalAlias:
case EventType.RoomServerAcl:
case M_BEACON.name:
Expand Down
1 change: 0 additions & 1 deletion test/Unread-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ describe('eventTriggersUnreadCount()', () => {
EventType.RoomThirdPartyInvite,
EventType.CallAnswer,
EventType.CallHangup,
EventType.RoomAliases,
EventType.RoomCanonicalAlias,
EventType.RoomServerAcl,
];
Expand Down

0 comments on commit 6009d1c

Please sign in to comment.