...
 
Commits (6)
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:ffi'; import 'dart:ffi';
import 'dart:typed_data';
import 'package:matrix_sdk/src/encryption/account.dart'; import 'package:matrix_sdk/src/encryption/account.dart';
import 'package:matrix_sdk/src/encryption/ffi/bindings.dart' hide Error; import 'package:matrix_sdk/src/encryption/ffi/bindings.dart' hide Error;
......
...@@ -114,7 +114,7 @@ abstract class MessageEvent extends RoomEvent { ...@@ -114,7 +114,7 @@ abstract class MessageEvent extends RoomEvent {
var info = content['info']; var info = content['info'];
if (info != null) { if (info != null) {
info = AudioInfo( info = AudioInfo(
duration: info['duration'], duration: Duration(milliseconds: info['duration'].round()),
mimetype: info['mimetype'], mimetype: info['mimetype'],
size: info['size'], size: info['size'],
); );
...@@ -333,7 +333,7 @@ class AudioMessage extends MessageEventContent { ...@@ -333,7 +333,7 @@ class AudioMessage extends MessageEventContent {
} }
class AudioInfo { class AudioInfo {
final int duration; final Duration duration;
final String mimetype; final String mimetype;
final int size; final int size;
......
...@@ -47,15 +47,17 @@ class PowerLevelsChangeEvent extends StateEvent { ...@@ -47,15 +47,17 @@ class PowerLevelsChangeEvent extends StateEvent {
} }
final Map<Type, int> events = jsonEvents.map((eventType, powerLevel) { final Map<Type, int> events = jsonEvents.map((eventType, powerLevel) {
powerLevel = powerLevel is String ? int.parse(powerLevel) : powerLevel;
return MapEntry<Type, int>(Event.typeOf(eventType), powerLevel); return MapEntry<Type, int>(Event.typeOf(eventType), powerLevel);
}).cast<Type, int>(); }).cast<Type, int>();
final int stateDefault = content['state_default'] ?? 50; final int stateDefault = content['state_default'] ?? 50;
final int userDefault = content['users_default'] ?? 0; final int userDefault = content['users_default'] ?? 0;
final Map<UserId, int> users = content['users'] final Map<UserId, int> users = content['users'].map((userId, powerLevel) {
.map((userId, powerLevel) => MapEntry(UserId(userId), powerLevel)) powerLevel = powerLevel is String ? int.parse(powerLevel) : powerLevel;
.cast<UserId, int>(); return MapEntry(UserId(userId), powerLevel);
}).cast<UserId, int>();
final roomNotifications = json.containsKey('notifications') final roomNotifications = json.containsKey('notifications')
? json['notifications']['room'] ?? 50 ? json['notifications']['room'] ?? 50
......
...@@ -36,7 +36,9 @@ class Members extends Storables<UserId, User> { ...@@ -36,7 +36,9 @@ class Members extends Storables<UserId, User> {
/// Note that this does not reflect how much members are /// Note that this does not reflect how much members are
/// in memory or in the store. This is the actual count of /// in memory or in the store. This is the actual count of
/// members in the [Room]. /// members in the [Room].
int count; ///
/// Is -1 if unknown.
int count = -1;
Members(this._room, this.count, String scope) : super(scope); Members(this._room, this.count, String scope) : super(scope);
......
...@@ -22,4 +22,4 @@ dev_dependencies: ...@@ -22,4 +22,4 @@ dev_dependencies:
mockito: ^4.1.0 mockito: ^4.1.0
build_runner: ^1.0.0 build_runner: ^1.0.0
chopper_generator: ^2.4.2 chopper_generator: ^2.4.2
dotenv: ^1.0.0 dotenv: ^1.0.0
\ No newline at end of file