1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-04-03 11:22:38 +00:00

Compare commits

...

8 Commits

8 changed files with 64 additions and 49 deletions

View File

@ -104,6 +104,8 @@ class ServerConfigurationHelper {
label: new Map<String, String>.from(cause["label"])))
.toList()),
maxCommentLength: reportPolicy["max_comment_length"],
canUserReportHisOwnContent:
reportPolicy["can_user_report_his_own_content"],
));
}

View File

@ -151,8 +151,13 @@ class ReportCause {
class ReportPolicy {
final List<ReportCause> causes;
final int maxCommentLength;
final bool canUserReportHisOwnContent;
const ReportPolicy({required this.causes, required this.maxCommentLength});
const ReportPolicy({
required this.causes,
required this.maxCommentLength,
required this.canUserReportHisOwnContent,
});
}
class ServerConfig {

View File

@ -135,7 +135,9 @@ class _AboutUserSectionState extends State<AboutUserSection> {
),
// Report user
!widget.user.isCurrentUser && srvConfig!.isReportingEnabled
srvConfig!.isReportingEnabled &&
(!widget.user.isCurrentUser ||
srvConfig!.reportPolicy!.canUserReportHisOwnContent)
? ListTile(
textColor: Colors.red,
leading: Icon(Icons.flag, color: Colors.red),

View File

@ -112,7 +112,9 @@ class CommentTile extends StatelessWidget {
child: Text(tr("Delete")!),
value: _CommentAction.DELETE,
),
]..addAll(srvConfig!.isReportingEnabled && !comment.isOwner
]..addAll(srvConfig!.isReportingEnabled &&
(!comment.isOwner ||
srvConfig!.reportPolicy!.canUserReportHisOwnContent)
? [
PopupMenuItem(
child: Text(tr("Report abuse")!),

View File

@ -97,8 +97,10 @@ class ConversationMessageTile extends StatelessWidget {
// Report the message
PopupMenuItem(
enabled:
srvConfig!.isReportingEnabled && !message.isOwner,
enabled: srvConfig!.isReportingEnabled &&
(!message.isOwner ||
srvConfig!.reportPolicy!
.canUserReportHisOwnContent),
value: _MenuChoices.REPORT,
child: Text(tr("Report abuse")!),
),

View File

@ -156,7 +156,9 @@ class _PostTileState extends State<PostTile> {
value: _PostActions.DELETE,
enabled: widget.post.canDelete,
),
]..addAll(srvConfig!.isReportingEnabled && !widget.post.isOwner
]..addAll(srvConfig!.isReportingEnabled &&
(!widget.post.isOwner ||
srvConfig!.reportPolicy!.canUserReportHisOwnContent)
? [
PopupMenuItem(
child: Text(tr("Report abuse")!),

View File

@ -7,7 +7,7 @@ packages:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.0"
version: "3.3.1"
args:
dependency: transitive
description:
@ -70,7 +70,7 @@ packages:
name: chewie
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.3"
version: "1.3.4"
chewie_audio:
dependency: "direct main"
description:
@ -105,7 +105,7 @@ packages:
name: connectivity_plus
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.3"
version: "2.3.6"
connectivity_plus_linux:
dependency: transitive
description:
@ -119,7 +119,7 @@ packages:
name: connectivity_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.3"
version: "1.2.4"
connectivity_plus_platform_interface:
dependency: transitive
description:
@ -133,7 +133,7 @@ packages:
name: connectivity_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
version: "1.2.3"
connectivity_plus_windows:
dependency: transitive
description:
@ -182,7 +182,7 @@ packages:
name: dbus
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.4"
version: "0.7.7"
dio:
dependency: "direct main"
description:
@ -217,7 +217,7 @@ packages:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
version: "2.0.1"
file:
dependency: transitive
description:
@ -231,7 +231,7 @@ packages:
name: file_picker
url: "https://pub.dartlang.org"
source: hosted
version: "4.6.1"
version: "5.0.1"
filesize:
dependency: "direct main"
description:
@ -245,42 +245,42 @@ packages:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "1.17.1"
version: "1.20.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "4.4.0"
version: "4.5.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
version: "1.7.1"
firebase_messaging:
dependency: "direct main"
description:
name: firebase_messaging
url: "https://pub.dartlang.org"
source: hosted
version: "11.4.1"
version: "12.0.1"
firebase_messaging_platform_interface:
dependency: transitive
description:
name: firebase_messaging_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.1"
version: "4.1.0"
firebase_messaging_web:
dependency: transitive
description:
name: firebase_messaging_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
version: "3.1.0"
flutter:
dependency: "direct main"
description: flutter
@ -327,7 +327,7 @@ packages:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
version: "2.0.7"
flutter_settings_ui:
dependency: "direct main"
description:
@ -341,7 +341,7 @@ packages:
name: flutter_svg
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.1+1"
flutter_test:
dependency: "direct dev"
description: flutter
@ -358,7 +358,7 @@ packages:
name: flutter_webrtc
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.9"
version: "0.9.1"
html:
dependency: "direct main"
description:
@ -421,7 +421,7 @@ packages:
name: image_picker_android
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.5"
version: "0.8.5+1"
image_picker_for_web:
dependency: transitive
description:
@ -435,14 +435,14 @@ packages:
name: image_picker_ios
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.5+5"
version: "0.8.5+6"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
version: "2.6.0"
intl:
dependency: "direct main"
description:
@ -519,7 +519,7 @@ packages:
name: package_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.2"
version: "1.4.3"
package_info_plus_linux:
dependency: transitive
description:
@ -554,7 +554,7 @@ packages:
name: package_info_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "2.0.0"
path:
dependency: transitive
description:
@ -589,14 +589,14 @@ packages:
name: path_provider_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.14"
version: "2.0.17"
path_provider_ios:
dependency: transitive
description:
name: path_provider_ios
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.9"
version: "2.0.11"
path_provider_linux:
dependency: transitive
description:
@ -624,7 +624,7 @@ packages:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.7"
version: "2.1.0"
pedantic:
dependency: transitive
description:
@ -687,7 +687,7 @@ packages:
name: pie_chart
url: "https://pub.dartlang.org"
source: hosted
version: "5.3.1"
version: "5.3.2"
platform:
dependency: transitive
description:
@ -736,7 +736,7 @@ packages:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.27.4"
version: "0.27.5"
shared_preferences:
dependency: "direct main"
description:
@ -818,7 +818,7 @@ packages:
name: sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2+1"
version: "2.0.3"
sqflite_common:
dependency: transitive
description:
@ -888,7 +888,7 @@ packages:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.3"
version: "6.1.5"
url_launcher_android:
dependency: transitive
description:
@ -923,14 +923,14 @@ packages:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
version: "2.1.0"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.11"
version: "2.0.12"
url_launcher_windows:
dependency: transitive
description:
@ -958,21 +958,21 @@ packages:
name: version
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "3.0.2"
video_player:
dependency: "direct main"
description:
name: video_player
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.4"
version: "2.4.5"
video_player_android:
dependency: transitive
description:
name: video_player_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.6"
version: "2.3.8"
video_player_avfoundation:
dependency: transitive
description:
@ -993,21 +993,21 @@ packages:
name: video_player_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.10"
version: "2.0.12"
video_thumbnail:
dependency: "direct main"
description:
name: video_thumbnail
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0"
version: "0.5.2"
wakelock:
dependency: "direct main"
description:
name: wakelock
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.1+2"
version: "0.6.2"
wakelock_macos:
dependency: transitive
description:
@ -1056,7 +1056,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.1"
version: "2.7.0"
xdg_directories:
dependency: transitive
description:

View File

@ -11,7 +11,7 @@ description: Comunic client
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.2.0+20
version: 1.2.2+22
environment:
sdk: '>=2.12.0 <3.0.0'
@ -80,19 +80,19 @@ dependencies:
event_bus: ^2.0.0
# WebRTC calls
flutter_webrtc: ^0.8.3
flutter_webrtc: ^0.9.1
# Prevent phone from auto-locking during calls
wakelock: ^0.6.1+2
# Pick any kind of file
file_picker: ^4.5.0
file_picker: ^5.0.1
# Get information about current version
package_info_plus: ^1.4.0
# Version manager
version: ^2.0.0
version: ^3.0.2
# Get path to temporary files
path_provider: ^2.0.9
@ -131,7 +131,7 @@ dependencies:
# Firebase cloud messaging (for push notifications)
firebase_core: ^1.13.1
firebase_messaging: ^11.2.8
firebase_messaging: ^12.0.1
# Forez presence
table_calendar: ^3.0.4