TF-3793 Hide warning message when use is organizer
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -383,21 +383,31 @@ extension CalendarEventExtension on CalendarEvent {
|
||||
return [];
|
||||
}
|
||||
|
||||
bool isDisplayedEventReplyAction(String ownerEmailAddress) => method != null
|
||||
&& _methodIsRepliable
|
||||
&& organizer != null
|
||||
&& participants?.isNotEmpty == true
|
||||
&& !validateUserIsNotListedInParticipants(ownerEmailAddress);
|
||||
bool isDisplayedEventReplyAction(String ownerEmailAddress) =>
|
||||
method != null &&
|
||||
_methodIsRepliable &&
|
||||
organizer != null &&
|
||||
participants?.isNotEmpty == true &&
|
||||
userIsListedInParticipants(ownerEmailAddress);
|
||||
|
||||
bool get _methodIsRepliable =>
|
||||
method == EventMethod.request ||
|
||||
method == EventMethod.add ||
|
||||
method == EventMethod.counter;
|
||||
|
||||
bool validateUserIsNotListedInParticipants(String ownEmailAddress) {
|
||||
bool userIsListedInParticipants(String ownEmailAddress) {
|
||||
final participant = participants?.firstWhereOrNull((participant) =>
|
||||
participant.mailto?.mailAddress.value == ownEmailAddress);
|
||||
return participant == null;
|
||||
return participant != null;
|
||||
}
|
||||
|
||||
bool userIsOrganizer(String ownEmailAddress) {
|
||||
return organizer?.mailto?.value == ownEmailAddress;
|
||||
}
|
||||
|
||||
bool isDisplayedWarningMessage(String ownerEmailAddress) {
|
||||
return !userIsListedInParticipants(ownerEmailAddress) &&
|
||||
!userIsOrganizer(ownerEmailAddress);
|
||||
}
|
||||
|
||||
bool get isDisplayedMailToAttendees =>
|
||||
|
||||
+1
-3
@@ -149,9 +149,7 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
||||
openEmailAddressDetailAction: openEmailAddressDetailAction,
|
||||
),
|
||||
),
|
||||
if (calendarEvent.validateUserIsNotListedInParticipants(
|
||||
ownEmailAddress,
|
||||
))
|
||||
if (calendarEvent.isDisplayedWarningMessage(ownEmailAddress))
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
top: CalendarEventInformationWidgetStyles.fieldTopPadding,
|
||||
|
||||
Reference in New Issue
Block a user