forked from Nexus/nexus
add dynamic hinting and latching for PMPs
This commit is contained in:
parent
225497030e
commit
c786344bf2
1 changed files with 120 additions and 37 deletions
|
|
@ -136,6 +136,24 @@ class RoomsController extends Notifier<IMap<String, Room>> {
|
|||
.add(event.eventId, event.rowId);
|
||||
});
|
||||
|
||||
void setAccountData(
|
||||
String roomId,
|
||||
String type,
|
||||
Map<String, dynamic>? content,
|
||||
) {
|
||||
if (state[roomId] case final room?) {
|
||||
state = state.add(
|
||||
roomId,
|
||||
room.copyWith(
|
||||
accountData: switch (content) {
|
||||
final content? => room.accountData.add(type, content),
|
||||
null => room.accountData.remove(type),
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void update(
|
||||
IMap<String, Room> rooms, [
|
||||
ISet<String> leftRooms = const .empty(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue