Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mentionedMessageTemplate field #91

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/src/public/core/message/admin_message.g.dart

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

1 change: 1 addition & 0 deletions lib/src/public/core/message/base_message.dart
Expand Up @@ -132,6 +132,7 @@ abstract class BaseMessage extends RootMessage {
super.extendedMessage,
super.createdAt,
super.updatedAt,
super.mentionedMessageTemplate,
Sender? sender,
this.requestId,
this.messageId = 0,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/public/core/message/file_message.g.dart

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

3 changes: 2 additions & 1 deletion lib/src/public/core/message/notification_message.g.dart

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

4 changes: 4 additions & 0 deletions lib/src/public/core/message/root_message.dart
Expand Up @@ -78,6 +78,9 @@ abstract class RootMessage {
@JsonKey(includeFromJson: false, includeToJson: false)
late Chat chat;

@JsonKey(name: 'mentioned_message_template')
String? mentionedMessageTemplate;

RootMessage({
required this.channelUrl,
required this.channelType,
Expand All @@ -89,6 +92,7 @@ abstract class RootMessage {
Map<String, dynamic>? extendedMessage,
this.createdAt = 0,
this.updatedAt = 0,
this.mentionedMessageTemplate,
}) : _mentionedUsers = mentionedUsers,
extendedMessage = extendedMessage ?? {};

Expand Down
2 changes: 2 additions & 0 deletions lib/src/public/core/message/user_message.dart
Expand Up @@ -56,6 +56,7 @@ class UserMessage extends BaseMessage {
List<String>? requestedMentionUserIds,
int createdAt = 0,
int updatedAt = 0,
String? mentionedMessageTemplate,
int? parentMessageId,
ThreadInfo? threadInfo,
List<MessageMetaArray>? metaArrays,
Expand Down Expand Up @@ -84,6 +85,7 @@ class UserMessage extends BaseMessage {
mentionType: mentionType,
createdAt: createdAt,
updatedAt: updatedAt,
mentionedMessageTemplate: mentionedMessageTemplate,
parentMessageId: parentMessageId,
parentMessage: parentMessage,
threadInfo: threadInfo,
Expand Down
5 changes: 4 additions & 1 deletion lib/src/public/core/message/user_message.g.dart

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

Expand Up @@ -36,6 +36,9 @@ class BaseMessageCreateParams {
/// Whether the message should be pinned to the channel. Defaults to false.
bool isPinnedMessage = false;

/// The mentioned message template of the message. Defaults to null.
String? mentionedMessageTemplate;

BaseMessageCreateParams({
this.data,
this.customType,
Expand All @@ -46,6 +49,7 @@ class BaseMessageCreateParams {
this.replyToChannel = false,
this.pushNotificationDeliveryOption = PushNotificationDeliveryOption.normal,
this.isPinnedMessage = false,
this.mentionedMessageTemplate,
});

/// withMessage
Expand Down Expand Up @@ -73,6 +77,7 @@ class BaseMessageCreateParams {
PushNotificationDeliveryOption.suppress)
'push_option': pushNotificationDeliveryOption.asString(),
'pin_message': isPinnedMessage,
'mentioned_message_template': mentionedMessageTemplate,
};

ret.removeWhere((key, value) => value == null);
Expand Down
Expand Up @@ -35,6 +35,7 @@ class UserMessageCreateParams extends BaseMessageCreateParams {
PushNotificationDeliveryOption pushNotificationDeliveryOption =
PushNotificationDeliveryOption.normal,
bool isPinnedMessage = false,
String? mentionedMessageTemplate,
}) : translationTargetLanguages = translationTargetLanguages ?? [],
super(
data: data,
Expand All @@ -46,6 +47,7 @@ class UserMessageCreateParams extends BaseMessageCreateParams {
replyToChannel: replyToChannel ?? false,
pushNotificationDeliveryOption: pushNotificationDeliveryOption,
isPinnedMessage: isPinnedMessage,
mentionedMessageTemplate: mentionedMessageTemplate,
);

/// withMessage
Expand Down