This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new 791c1f3  [OPENMEETINGS-2481] first attempt to fix cancelation on 
Mozilla
791c1f3 is described below

commit 791c1f39dea96e9291c27d952310d93da2287e99
Author: Maxim Solodovnik <solomax...@gmail.com>
AuthorDate: Fri Oct 16 21:53:28 2020 +0700

    [OPENMEETINGS-2481] first attempt to fix cancelation on Mozilla
---
 .../org/apache/openmeetings/service/room/InvitationManager.java     | 6 +++++-
 .../main/java/org/apache/openmeetings/util/mail/IcalHandler.java    | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/openmeetings-service/src/main/java/org/apache/openmeetings/service/room/InvitationManager.java
 
b/openmeetings-service/src/main/java/org/apache/openmeetings/service/room/InvitationManager.java
index a4eae5c..53a69db 100644
--- 
a/openmeetings-service/src/main/java/org/apache/openmeetings/service/room/InvitationManager.java
+++ 
b/openmeetings-service/src/main/java/org/apache/openmeetings/service/room/InvitationManager.java
@@ -113,10 +113,14 @@ public class InvitationManager implements 
IInvitationManager {
                        String username = i.getInvitee().getLogin();
                        boolean isOwner = 
owner.getId().equals(i.getInvitee().getId());
                        Appointment a = i.getAppointment();
+                       String desc = a.getDescription() == null ? "" : 
a.getDescription();
+                       if (invitationLink != null) {
+                               desc += (desc.isEmpty() ? "" : "\n\n\n") + 
invitationLink;
+                       }
                        IcalHandler handler = new 
IcalHandler(MessageType.CANCEL == type ? IcalHandler.ICAL_METHOD_CANCEL : 
IcalHandler.ICAL_METHOD_REQUEST)
                                        
.createVEvent(getTimeZone(owner).getID(), a.getStart(), a.getEnd(), 
a.getTitle())
                                        .setLocation(a.getLocation())
-                                       .setDescription(a.getDescription() + 
"\n\n\n" + invitationLink)
+                                       .setDescription(desc)
                                        .setUid(a.getIcalId())
                                        .setSequence(0)
                                        .addOrganizer(replyToEmail, 
owner.getLogin())
diff --git 
a/openmeetings-util/src/main/java/org/apache/openmeetings/util/mail/IcalHandler.java
 
b/openmeetings-util/src/main/java/org/apache/openmeetings/util/mail/IcalHandler.java
index b9fbb9b..7f10b71 100644
--- 
a/openmeetings-util/src/main/java/org/apache/openmeetings/util/mail/IcalHandler.java
+++ 
b/openmeetings-util/src/main/java/org/apache/openmeetings/util/mail/IcalHandler.java
@@ -37,6 +37,7 @@ import net.fortuna.ical4j.model.TimeZoneRegistry;
 import net.fortuna.ical4j.model.TimeZoneRegistryFactory;
 import net.fortuna.ical4j.model.component.VEvent;
 import net.fortuna.ical4j.model.parameter.Cn;
+import net.fortuna.ical4j.model.parameter.PartStat;
 import net.fortuna.ical4j.model.parameter.Role;
 import net.fortuna.ical4j.model.property.Attendee;
 import net.fortuna.ical4j.model.property.CalScale;
@@ -66,6 +67,7 @@ public class IcalHandler {
        private final Calendar icsCalendar;
        private TimeZone timeZone;
        private VEvent meeting;
+       private Method method;
 
        /** Creation of a new Event */
        public static final Method ICAL_METHOD_REQUEST = Method.REQUEST;
@@ -79,6 +81,7 @@ public class IcalHandler {
         *            (@see IcalHandler) constants
         */
        public IcalHandler(Method method) {
+               this.method = method;
                log.debug("Icalhandler method type : {}", method);
 
                icsCalendar = new Calendar();
@@ -141,6 +144,7 @@ public class IcalHandler {
                Attendee uno = new Attendee(URI.create(MAILTO + email));
                uno.getParameters().add(chair ? Role.CHAIR : 
Role.REQ_PARTICIPANT);
                uno.getParameters().add(new Cn(display));
+               uno.getParameters().add(Method.CANCEL == method ? 
PartStat.DECLINED : PartStat.ACCEPTED);
                meeting.getProperties().add(uno);
                return this;
        }

Reply via email to