Skip to content

Commit 7c4130c

Browse files
committed
feat: add configuration support for video button in contact info
1 parent 54b83ad commit 7c4130c

5 files changed

Lines changed: 230 additions & 10 deletions

File tree

assets/themes/app.config.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,10 @@
265265
"messaging": {
266266
"sms": {},
267267
"chats": {
268-
"groupChatButtonEnabled": true
268+
"groupChatButtonEnabled": true,
269+
"contactInfo": {
270+
"showVideoButtonAction": false
271+
}
269272
}
270273
}
271274
}

lib/data/feature_access.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ abstract final class MessagingMapper {
366366
coreChatsSupport: coreSupport.supportsChats,
367367
tabEnabled: tabEnabled,
368368
groupChatSupport: appConfig.messaging.chats.groupChatButtonEnabled,
369-
contactInfoVideoCallSupport: true,
369+
contactInfoVideoCallSupport: appConfig.messaging.chats.contactInfo.showVideoButtonAction,
370370
);
371371
}
372372
}

packages/webtrit_appearance_theme/lib/models/features_config/app_config.dart

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,12 +612,28 @@ class AppConfigSms with _$AppConfigSms {
612612
@freezed
613613
@JsonSerializable(explicitToJson: true)
614614
class AppConfigChats with _$AppConfigChats {
615-
const AppConfigChats({this.groupChatButtonEnabled = true});
615+
const AppConfigChats({this.groupChatButtonEnabled = true, this.contactInfo = const ChatContactInfo()});
616616

617617
@override
618618
final bool groupChatButtonEnabled;
619619

620+
@override
621+
final ChatContactInfo contactInfo;
622+
620623
factory AppConfigChats.fromJson(Map<String, Object?> json) => _$AppConfigChatsFromJson(json);
621624

622625
Map<String, Object?> toJson() => _$AppConfigChatsToJson(this);
623626
}
627+
628+
@freezed
629+
@JsonSerializable(explicitToJson: true)
630+
class ChatContactInfo with _$ChatContactInfo {
631+
const ChatContactInfo({this.showVideoButtonAction = true});
632+
633+
@override
634+
final bool showVideoButtonAction;
635+
636+
factory ChatContactInfo.fromJson(Map<String, Object?> json) => _$ChatContactInfoFromJson(json);
637+
638+
Map<String, Object?> toJson() => _$ChatContactInfoToJson(this);
639+
}

packages/webtrit_appearance_theme/lib/models/features_config/app_config.freezed.dart

Lines changed: 194 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/webtrit_appearance_theme/lib/models/features_config/app_config.g.dart

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)