Update lib/src/Store.dart
This commit is contained in:
parent
6101a2251a
commit
cf60b50954
|
@ -184,15 +184,12 @@ class Store {
|
||||||
case "m.direct":
|
case "m.direct":
|
||||||
if (userUpdate.content["content"] is Map<String, dynamic>) {
|
if (userUpdate.content["content"] is Map<String, dynamic>) {
|
||||||
final Map<String, dynamic> directMap = userUpdate.content["content"];
|
final Map<String, dynamic> directMap = userUpdate.content["content"];
|
||||||
print("Direct Map =========> $directMap");
|
directMap.forEach((String key, dynamic value) {
|
||||||
directMap.forEach((String key, dynamic value) async{
|
|
||||||
print("Handle direct Matrix ID ===========> $key");
|
|
||||||
if (value is List<dynamic> && value.length > 0)
|
if (value is List<dynamic> && value.length > 0)
|
||||||
for (int i = 0; i < value.length; i++) {
|
for (int i = 0; i < value.length; i++) {
|
||||||
final changesCount = await txn.rawUpdate(
|
txn.rawUpdate(
|
||||||
"UPDATE Rooms SET direct_chat_matrix_id=? WHERE id=?",
|
"UPDATE Rooms SET direct_chat_matrix_id=? WHERE id=?",
|
||||||
[key, value[i]]);
|
[key, value[i]]);
|
||||||
if (changesCount == 0) print("Direct chat of $key to Room ${value[i]}, was not stored");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue