Constructor
new RoomUpgradeHandler(opts, bridge)
Parameters:
Name | Type | Description |
---|---|---|
opts |
RoomUpgradeHandler~Options | |
bridge |
Bridge | The parent bridge. |
Type Definitions
MigrateEntry(entry, newRoomId) → {RoomBridgeStore~Entry}
Invoked when iterating around a rooms entries. Should be used to update entries
with a new room id.
Parameters:
Name | Type | Description |
---|---|---|
entry |
RoomBridgeStore~Entry | The existing entry. |
newRoomId |
string | The new roomId. |
Returns:
Return the entry to upsert it,
or null to ignore it.
onRoomMigrated(oldRoomId, newRoomId)
Invoked after a room has been upgraded and it's entries updated.
Parameters:
Name | Type | Description |
---|---|---|
oldRoomId |
string | The old roomId. |
newRoomId |
string | The new roomId. |
Options
Options to supply to the RoomUpgradeHandler.
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
migrateEntry |
RoomUpgradeHandler~MigrateEntry | Called when the handler wishes to migrate a MatrixRoom entry to a new room_id. If omitted, RoomUpgradeHandler~_migrateEntry will be used instead. | ||
onRoomMigrated |
RoomUpgradeHandler~onRoomMigrated | This is called when the entries of the room have been migrated, the bridge should do any cleanup it needs of the old room and setup the new room (ex: Joining ghosts to the new room). | ||
consumeEvent |
bool |
<optional> |
true | Consume tombstone or invite events that are acted on by this handler. |
migrateGhosts |
bool |
<optional> |
true | If given, migrate all ghost users across to the new room. |