Skip to content

Commit

Permalink
fix: removing unecessary reply content and fixing return
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulRodrigo06 committed Nov 16, 2023
1 parent aef600d commit ef5ab9c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
5 changes: 0 additions & 5 deletions lib/src/models/ds_message_item.model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class DSMessageItemModel {
/// Customer data
Map<String, dynamic>? customer;

/// The message content
dynamic replyContent;

/// Used to define if a message detail (typicament a messages date and time) should be displayed or not
bool? hideMessageDetail;

Expand All @@ -44,7 +41,6 @@ class DSMessageItemModel {
this.content,
this.customer,
this.hideMessageDetail,
this.replyContent,
});

factory DSMessageItemModel.fromJson(Map<String, dynamic> json) {
Expand All @@ -57,7 +53,6 @@ class DSMessageItemModel {
content: json['content'],
status: DSDeliveryReportStatus.unknown.getValue(json['status']),
hideMessageDetail: json['hideMessageDetail'],
replyContent: json['replyContent'],
);

if (json.containsKey('customer')) {
Expand Down
8 changes: 2 additions & 6 deletions lib/src/widgets/chat/ds_reply_container.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,10 @@ Widget _replyWidget(
DSMessageBubbleStyle style,
DSAlign align,
) {
final replyType =
replyContent != '' ? replyContent['content']['replied']['type'] : '';
switch (replyType) {
switch (replyContent['type']) {
case DSMessageContentType.textPlain:
return DSBodyText(
replyContent['content']['replied']['value'] is String
? replyContent['content']['replied']['value']
: '**********',
replyContent['value'] is String ? replyContent['value'] : '**********',
color: _color(align, style),
overflow: TextOverflow.visible,
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/utils/ds_card.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class DSCard extends StatelessWidget {
onOpenLink: onOpenLink,
messageId: messageId,
customer: customer,
replyContent: replyContent,
replyContent: content['inReplyTo'],
);

case DSMessageContentType.mediaLink:
Expand Down
1 change: 0 additions & 1 deletion lib/src/widgets/utils/ds_group_card.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ class _DSGroupCardState extends State<DSGroupCard> {
onOpenLink: widget.onOpenLink,
messageId: message.id,
customer: message.customer,
replyContent: message.replyContent,
);

final isLastMsg = msgCount == length;
Expand Down

0 comments on commit ef5ab9c

Please sign in to comment.