Update lib/src/client.dart, lib/src/user.dart, lib/src/timeline.dart, lib/src/room.dart, lib/src/presence.dart, lib/src/event.dart, lib/src/utils/profile.dart, lib/src/utils/receipt.dart, test/client_test.dart, test/event_test.dart, test/presence_test.dart, test/room_test.dart, test/timeline_test.dart, test/user_test.dart files
2020-01-04 17:56:17 +00:00
|
|
|
import 'package:famedlysdk/src/utils/mx_content.dart';
|
2019-11-30 09:36:30 +00:00
|
|
|
|
|
|
|
/// Represents a user profile returned by a /profile request.
|
|
|
|
class Profile {
|
|
|
|
/// The user's avatar URL if they have set one, otherwise null.
|
|
|
|
final MxContent avatarUrl;
|
|
|
|
|
|
|
|
/// The user's display name if they have set one, otherwise null.
|
|
|
|
final String displayname;
|
|
|
|
|
|
|
|
/// This API may return keys which are not limited to displayname or avatar_url.
|
|
|
|
final Map<String, dynamic> content;
|
|
|
|
|
|
|
|
Profile.fromJson(Map<String, dynamic> json)
|
|
|
|
: avatarUrl = MxContent(json['avatar_url']),
|
|
|
|
displayname = json['displayname'],
|
|
|
|
content = json;
|
2020-01-18 14:49:15 +00:00
|
|
|
|
2020-03-30 09:08:38 +00:00
|
|
|
@override
|
2020-01-18 14:49:15 +00:00
|
|
|
bool operator ==(dynamic other) =>
|
2020-03-30 09:08:38 +00:00
|
|
|
avatarUrl.mxc == other.avatarUrl.mxc && displayname == other.displayname;
|
2019-11-30 09:36:30 +00:00
|
|
|
}
|