Implemented RichObjectString in text messages

This commit is contained in:
2023-02-21 16:59:20 +01:00
parent cee122602f
commit 5f140821a8
7 changed files with 119 additions and 86 deletions

View File

@ -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,