1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-04-06 04:39:21 +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"]))) label: new Map<String, String>.from(cause["label"])))
.toList()), .toList()),
maxCommentLength: reportPolicy["max_comment_length"], maxCommentLength: reportPolicy["max_comment_length"],
canUserReportHisOwnContent:
reportPolicy["can_user_report_his_own_content"],
)); ));
} }

View File

@ -151,8 +151,13 @@ class ReportCause {
class ReportPolicy { class ReportPolicy {
final List<ReportCause> causes; final List<ReportCause> causes;
final int maxCommentLength; 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 { class ServerConfig {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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