Various roominfo tweaks (#2607)

This commit is contained in:
Neil Alexander 2022-08-02 12:27:15 +01:00 committed by GitHub
parent eab87ef07d
commit ca3fa58388
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 50 additions and 16 deletions

View file

@ -310,3 +310,16 @@ func (r *RoomInfo) SetIsStub(isStub bool) {
defer r.mu.Unlock()
r.isStub = isStub
}
func (r *RoomInfo) CopyFrom(r2 *RoomInfo) {
r.mu.Lock()
defer r.mu.Unlock()
r2.mu.RLock()
defer r2.mu.RUnlock()
r.RoomNID = r2.RoomNID
r.RoomVersion = r2.RoomVersion
r.stateSnapshotNID = r2.stateSnapshotNID
r.isStub = r2.isStub
}