Skip to content

Commit

Permalink
updated mesage class
Browse files Browse the repository at this point in the history
  • Loading branch information
DinoLeung committed Apr 6, 2024
1 parent 375d9de commit 0c6407a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 39 deletions.
8 changes: 2 additions & 6 deletions lib/src/teledart/model/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,11 @@ class TeleDartMessage extends Message {
date: message.date,
senderChat: message.senderChat,
chat: message.chat,
forwardFrom: message.forwardFrom,
forwardFromChat: message.forwardFromChat,
forwardFromMessageId: message.forwardFromMessageId,
forwardSignature: message.forwardSignature,
forwardSenderName: message.forwardSenderName,
forwardDate: message.forwardDate,
forwardOrigin: message.forwardOrigin,
isTopicMessage: message.isTopicMessage,
isAutomaticForward: message.isAutomaticForward,
replyToMessage: message.replyToMessage,
externalReply: message.externalReply,
viaBot: message.viaBot,
editDate: message.editDate,
hasProtectedContent: message.hasProtectedContent,
Expand Down
24 changes: 9 additions & 15 deletions lib/src/telegram/model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 4 additions & 18 deletions lib/src/telegram/models/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,11 @@ class Message {
Chat? senderChat;
int date;
Chat chat;
User? forwardFrom;
Chat? forwardFromChat;
int? forwardFromMessageId;
String? forwardSignature;
String? forwardSenderName;
int? forwardDate;
MessageOrigin? forwardOrigin;
bool? isTopicMessage;
bool? isAutomaticForward;
Message? replyToMessage;
ExternalReplyInfo? externalReply;
User? viaBot;
int? editDate;
bool? hasProtectedContent;
Expand Down Expand Up @@ -103,15 +99,11 @@ class Message {
this.senderChat,
required this.date,
required this.chat,
this.forwardFrom,
this.forwardFromChat,
this.forwardFromMessageId,
this.forwardSignature,
this.forwardSenderName,
this.forwardDate,
this.forwardOrigin,
this.isTopicMessage,
this.isAutomaticForward,
this.replyToMessage,
this.externalReply,
this.viaBot,
this.editDate,
this.hasProtectedContent,
Expand Down Expand Up @@ -175,12 +167,6 @@ class Message {
DateTime get date_ => TimeHelper.toDateTime(date);
set date_(DateTime dateTime) => date = TimeHelper.toUnixTime(dateTime);

@JsonKey(includeFromJson: false, includeToJson: false)
DateTime? get forwardDate_ =>
forwardDate == null ? null : TimeHelper.toDateTime(forwardDate!);
set forwardDate_(DateTime? dateTime) =>
forwardDate = dateTime == null ? null : TimeHelper.toUnixTime(dateTime);

@JsonKey(includeFromJson: false, includeToJson: false)
DateTime? get editDate_ =>
editDate == null ? null : TimeHelper.toDateTime(editDate!);
Expand Down

0 comments on commit 0c6407a

Please sign in to comment.