Implemented RichObjectString in text messages
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:marianum_mobile/api/apiResponse.dart';
|
||||
|
||||
import '../chat/getChatResponse.dart';
|
||||
|
||||
part 'getRoomResponse.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
@ -48,7 +50,7 @@ class GetRoomResponseObject {
|
||||
bool unreadMentionDirect;
|
||||
int lastReadMessage;
|
||||
int lastCommonReadMessage;
|
||||
GetRoomResponseObjectMessage lastMessage;
|
||||
GetChatResponseObject lastMessage;
|
||||
String? status;
|
||||
String? statusIcon;
|
||||
String? statusMessage;
|
||||
@ -104,37 +106,37 @@ enum GetRoomResponseObjectParticipantNotificationLevel {
|
||||
@JsonValue(3) neverNotify,
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GetRoomResponseObjectMessage {
|
||||
int id;
|
||||
String token;
|
||||
GetRoomResponseObjectMessageActorType actorType;
|
||||
String actorId;
|
||||
String actorDisplayName;
|
||||
int timestamp;
|
||||
String message;
|
||||
String systemMessage;
|
||||
GetRoomResponseObjectMessageType messageType;
|
||||
bool isReplyable;
|
||||
String referenceId;
|
||||
|
||||
|
||||
GetRoomResponseObjectMessage(
|
||||
this.id,
|
||||
this.token,
|
||||
this.actorType,
|
||||
this.actorId,
|
||||
this.actorDisplayName,
|
||||
this.timestamp,
|
||||
this.message,
|
||||
this.systemMessage,
|
||||
this.messageType,
|
||||
this.isReplyable,
|
||||
this.referenceId);
|
||||
|
||||
factory GetRoomResponseObjectMessage.fromJson(Map<String, dynamic> json) => _$GetRoomResponseObjectMessageFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$GetRoomResponseObjectMessageToJson(this);
|
||||
}
|
||||
// @JsonSerializable(explicitToJson: true)
|
||||
// class GetRoomResponseObjectMessage {
|
||||
// int id;
|
||||
// String token;
|
||||
// GetRoomResponseObjectMessageActorType actorType;
|
||||
// String actorId;
|
||||
// String actorDisplayName;
|
||||
// int timestamp;
|
||||
// String message;
|
||||
// String systemMessage;
|
||||
// GetRoomResponseObjectMessageType messageType;
|
||||
// bool isReplyable;
|
||||
// String referenceId;
|
||||
//
|
||||
//
|
||||
// GetRoomResponseObjectMessage(
|
||||
// this.id,
|
||||
// this.token,
|
||||
// this.actorType,
|
||||
// this.actorId,
|
||||
// this.actorDisplayName,
|
||||
// this.timestamp,
|
||||
// this.message,
|
||||
// this.systemMessage,
|
||||
// this.messageType,
|
||||
// this.isReplyable,
|
||||
// this.referenceId);
|
||||
//
|
||||
// factory GetRoomResponseObjectMessage.fromJson(Map<String, dynamic> json) => _$GetRoomResponseObjectMessageFromJson(json);
|
||||
// Map<String, dynamic> toJson() => _$GetRoomResponseObjectMessageToJson(this);
|
||||
// }
|
||||
|
||||
enum GetRoomResponseObjectMessageActorType {
|
||||
@JsonValue("users") user,
|
||||
|
@ -48,7 +48,7 @@ GetRoomResponseObject _$GetRoomResponseObjectFromJson(
|
||||
json['unreadMentionDirect'] as bool,
|
||||
json['lastReadMessage'] as int,
|
||||
json['lastCommonReadMessage'] as int,
|
||||
GetRoomResponseObjectMessage.fromJson(
|
||||
GetChatResponseObject.fromJson(
|
||||
json['lastMessage'] as Map<String, dynamic>),
|
||||
json['status'] as String?,
|
||||
json['statusIcon'] as String?,
|
||||
@ -106,53 +106,3 @@ const _$GetRoomResponseObjectParticipantNotificationLevelEnumMap = {
|
||||
GetRoomResponseObjectParticipantNotificationLevel.notifyOnMention: 2,
|
||||
GetRoomResponseObjectParticipantNotificationLevel.neverNotify: 3,
|
||||
};
|
||||
|
||||
GetRoomResponseObjectMessage _$GetRoomResponseObjectMessageFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
GetRoomResponseObjectMessage(
|
||||
json['id'] as int,
|
||||
json['token'] as String,
|
||||
$enumDecode(
|
||||
_$GetRoomResponseObjectMessageActorTypeEnumMap, json['actorType']),
|
||||
json['actorId'] as String,
|
||||
json['actorDisplayName'] as String,
|
||||
json['timestamp'] as int,
|
||||
json['message'] as String,
|
||||
json['systemMessage'] as String,
|
||||
$enumDecode(
|
||||
_$GetRoomResponseObjectMessageTypeEnumMap, json['messageType']),
|
||||
json['isReplyable'] as bool,
|
||||
json['referenceId'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetRoomResponseObjectMessageToJson(
|
||||
GetRoomResponseObjectMessage instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'token': instance.token,
|
||||
'actorType':
|
||||
_$GetRoomResponseObjectMessageActorTypeEnumMap[instance.actorType]!,
|
||||
'actorId': instance.actorId,
|
||||
'actorDisplayName': instance.actorDisplayName,
|
||||
'timestamp': instance.timestamp,
|
||||
'message': instance.message,
|
||||
'systemMessage': instance.systemMessage,
|
||||
'messageType':
|
||||
_$GetRoomResponseObjectMessageTypeEnumMap[instance.messageType]!,
|
||||
'isReplyable': instance.isReplyable,
|
||||
'referenceId': instance.referenceId,
|
||||
};
|
||||
|
||||
const _$GetRoomResponseObjectMessageActorTypeEnumMap = {
|
||||
GetRoomResponseObjectMessageActorType.user: 'users',
|
||||
GetRoomResponseObjectMessageActorType.guest: 'guests',
|
||||
GetRoomResponseObjectMessageActorType.bot: 'bots',
|
||||
GetRoomResponseObjectMessageActorType.bridge: 'bridged',
|
||||
};
|
||||
|
||||
const _$GetRoomResponseObjectMessageTypeEnumMap = {
|
||||
GetRoomResponseObjectMessageType.comment: 'comment',
|
||||
GetRoomResponseObjectMessageType.deletedComment: 'comment_deleted',
|
||||
GetRoomResponseObjectMessageType.system: 'system',
|
||||
GetRoomResponseObjectMessageType.command: 'command',
|
||||
};
|
||||
|
Reference in New Issue
Block a user