|
|
@ -28,6 +28,7 @@ class Message { |
|
|
|
AtElem? atElem; |
|
|
|
AtElem? atElem; |
|
|
|
LocationElem? locationElem; |
|
|
|
LocationElem? locationElem; |
|
|
|
CustomElem? customElem; |
|
|
|
CustomElem? customElem; |
|
|
|
|
|
|
|
QuoteElem? quoteElem; |
|
|
|
|
|
|
|
|
|
|
|
Message({ |
|
|
|
Message({ |
|
|
|
this.clientMsgID, |
|
|
|
this.clientMsgID, |
|
|
@ -57,6 +58,7 @@ class Message { |
|
|
|
this.atElem, |
|
|
|
this.atElem, |
|
|
|
this.locationElem, |
|
|
|
this.locationElem, |
|
|
|
this.customElem, |
|
|
|
this.customElem, |
|
|
|
|
|
|
|
this.quoteElem, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
Message.fromJson(Map<String, dynamic> json) |
|
|
|
Message.fromJson(Map<String, dynamic> json) |
|
|
@ -102,6 +104,9 @@ class Message { |
|
|
|
customElem = json['customElem'] != null |
|
|
|
customElem = json['customElem'] != null |
|
|
|
? CustomElem.fromJson(json['customElem']) |
|
|
|
? CustomElem.fromJson(json['customElem']) |
|
|
|
: null; |
|
|
|
: null; |
|
|
|
|
|
|
|
quoteElem = json['quoteElem'] != null |
|
|
|
|
|
|
|
? QuoteElem.fromJson(json['quoteElem']) |
|
|
|
|
|
|
|
: null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() { |
|
|
|
Map<String, dynamic> toJson() { |
|
|
@ -133,24 +138,22 @@ class Message { |
|
|
|
data['atElem'] = this.atElem?.toJson(); |
|
|
|
data['atElem'] = this.atElem?.toJson(); |
|
|
|
data['locationElem'] = this.locationElem?.toJson(); |
|
|
|
data['locationElem'] = this.locationElem?.toJson(); |
|
|
|
data['customElem'] = this.customElem?.toJson(); |
|
|
|
data['customElem'] = this.customElem?.toJson(); |
|
|
|
|
|
|
|
data['quoteElem'] = this.quoteElem?.toJson(); |
|
|
|
return data; |
|
|
|
return data; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
bool operator ==(Object other) { |
|
|
|
bool operator ==(Object other) { |
|
|
|
// TODO: implement == |
|
|
|
|
|
|
|
if (other is Message) { |
|
|
|
if (other is Message) { |
|
|
|
return other._id == _id; |
|
|
|
return other._id == _id; |
|
|
|
} |
|
|
|
} |
|
|
|
return super == other; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
// TODO: implement hashCode |
|
|
|
|
|
|
|
int get hashCode => super.hashCode; |
|
|
|
int get hashCode => super.hashCode; |
|
|
|
|
|
|
|
|
|
|
|
String? get _id => |
|
|
|
String? get _id => clientMsgID; |
|
|
|
clientMsgID == null || clientMsgID!.isEmpty ? serverMsgID : clientMsgID; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class PictureElem { |
|
|
|
class PictureElem { |
|
|
@ -426,6 +429,27 @@ class CustomElem { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QuoteElem { |
|
|
|
|
|
|
|
String? text; |
|
|
|
|
|
|
|
Message? quoteMessage; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QuoteElem({this.text, this.quoteMessage}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QuoteElem.fromJson(Map<String, dynamic> json) { |
|
|
|
|
|
|
|
text = json['text']; |
|
|
|
|
|
|
|
if (json['quoteMessage'] is Map) { |
|
|
|
|
|
|
|
quoteMessage = Message.fromJson(json['quoteMessage']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() { |
|
|
|
|
|
|
|
final Map<String, dynamic> data = new Map<String, dynamic>(); |
|
|
|
|
|
|
|
data['text'] = this.text; |
|
|
|
|
|
|
|
data['quoteMessage'] = this.quoteMessage?.toJson(); |
|
|
|
|
|
|
|
return data; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class HaveReadInfo { |
|
|
|
class HaveReadInfo { |
|
|
|
String? uid; |
|
|
|
String? uid; |
|
|
|
List<String>? msgIDList; |
|
|
|
List<String>? msgIDList; |
|
|
|