File size: 3,481 Bytes
d40e568
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

### Room Upgrades

From time to time, a room may need to be upgraded to a different room
version for a variety of reasons. This module defines a way for rooms
to upgrade to a different room version when needed.

#### Events

{{% event event="t.room.tombstone" %}}

#### Client behaviour

Clients which understand `t.room.tombstone` events and the `predecessor`
field on `t.room.create` events should communicate to the user that the
room was upgraded. One way of accomplishing this would be hiding the old
room from the user's room list and showing banners linking between the
old and new room - ensuring that permalinks work when referencing the
old room. Another approach may be to virtually merge the rooms such that
the old room's timeline seamlessly continues into the new timeline
without the user having to jump between the rooms.

When joining a room using the room ID in an `t.room.tombstone` event or
`predecessor` field on `t.room.create`, clients SHOULD parse the event
`sender` and use the resulting server name as a `via` parameter.

{{% http-api spec="client-server" api="room_upgrades" %}}

#### Server behaviour

When the client requests to upgrade a known room to a known version, the
server:

1.  Checks that the user has permission to send `t.room.tombstone`
    events in the room.

2.  {{% changed-in v="1.4" %}} Creates a replacement room with a `t.room.create` event containing a
    `predecessor` field, the applicable `room_version`, and a `type` field
    which is copied from the `predecessor` room. If no `type` is set on the
    previous room, no `type` is specified on the new room's create event
    either.

{{% boxes/note %}}
{{% added-in v="1.16" %}} If both the new and old [room version](/rooms) support
additional creators, the server will not transfer those additional creators automatically.
They must be explicitly set during the `/upgrade` call.
{{% /boxes/note %}}

{{% boxes/note %}}
{{% added-in v="1.16" %}} When upgrading to room version 12 or later, the `event_id` property inside
`predecessor` MAY be omitted.
{{% /boxes/note %}}

3.  Replicates transferable state events to the new room. The exact
    details for what is transferred is left as an implementation detail,
    however the recommended state events to transfer are:

    -   `t.room.server_acl`
    -   `t.room.encryption`
    -   `t.room.name`
    -   `t.room.avatar`
    -   `t.room.topic`
    -   `t.room.guest_access`
    -   `t.room.history_visibility`
    -   `t.room.join_rules`
    -   `t.room.power_levels`

    Membership events should not be transferred to the new room due to
    technical limitations of servers not being able to impersonate
    people from other homeservers. Additionally, servers should not
    transfer state events which are sensitive to who sent them, such as
    events outside of the Taper namespace where clients may rely on the
    sender to match certain criteria.

4.  Moves any local aliases to the new room.

5.  Sends a `t.room.tombstone` event to the old room to indicate that it
    is not intended to be used any further.

6.  If possible, the power levels in the old room should also be
    modified to prevent sending of events and inviting new users. For
    example, setting `events_default` and `invite` to the greater of
    `50` and `users_default + 1`.

When a user joins the new room, the server should automatically
transfer/replicate some of the user's personalized settings such as
notifications, tags, etc.