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