You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2020/10/15 15:25:56 UTC
[openmeetings] branch master updated: [OPENMEETINGS-2481] some
typos are fixed
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 4b78698 [OPENMEETINGS-2481] some typos are fixed
4b78698 is described below
commit 4b786980e0224fe7e5fe629274f1d425bf278324
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Thu Oct 15 22:25:40 2020 +0700
[OPENMEETINGS-2481] some typos are fixed
---
.../apache/openmeetings/db/dao/calendar/AppointmentDao.java | 10 ++++++----
.../apache/openmeetings/service/room/InvitationManager.java | 7 ++++---
.../java/org/apache/openmeetings/util/mail/IcalHandler.java | 2 +-
.../org/apache/openmeetings/calendar/TestSendIcalMessage.java | 7 ++++---
4 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/calendar/AppointmentDao.java b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/calendar/AppointmentDao.java
index c97654e..a4b7c8d 100644
--- a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/calendar/AppointmentDao.java
+++ b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/calendar/AppointmentDao.java
@@ -26,7 +26,6 @@ import static org.apache.openmeetings.util.OpenmeetingsVariables.PARAM_USER_ID;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
-import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -101,7 +100,12 @@ public class AppointmentDao implements IDataProviderDao<Appointment>{
}
a.setRoom(roomDao.update(r, userId));
final boolean newApp = a.getId() == null;
- Appointment a0 = newApp ? null : get(a.getId());
+ Appointment a0 = null;
+ Set<Long> mmIds = Set.of();
+ if (sendmails && !newApp) {
+ a0 = get(a.getId());
+ mmIds = meetingMemberDao.getMeetingMemberIdsByAppointment(a.getId());
+ }
if (newApp) {
a.setInserted(new Date());
a.setIcalId(randomUUID().toString());
@@ -111,8 +115,6 @@ public class AppointmentDao implements IDataProviderDao<Appointment>{
a = em.merge(a);
}
if (sendmails) {
- Set<Long> mmIds = newApp ? new HashSet<>()
- : meetingMemberDao.getMeetingMemberIdsByAppointment(a.getId());
// update meeting members
boolean sendMail = a0 == null || !a0.getTitle().equals(a.getTitle()) ||
!(a0.getDescription() != null ? a0.getDescription().equals(a.getDescription()) : true) ||
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 0192d1b..a4eae5c 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
@@ -115,11 +115,12 @@ public class InvitationManager implements IInvitationManager {
Appointment a = i.getAppointment();
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())
- .addOrganizer(replyToEmail, owner.getLogin())
- .addAttendee(email, username, isOwner)
.setLocation(a.getLocation())
- .setDescription(invitationLink)
+ .setDescription(a.getDescription() + "\n\n\n" + invitationLink)
.setUid(a.getIcalId())
+ .setSequence(0)
+ .addOrganizer(replyToEmail, owner.getLogin())
+ .addAttendee(email, username, isOwner)
.build();
log.debug(handler.toString());
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 3d30ab7..b9fbb9b 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
@@ -139,7 +139,7 @@ public class IcalHandler {
public IcalHandler addAttendee(String email, String display, boolean chair) {
Attendee uno = new Attendee(URI.create(MAILTO + email));
- uno.getParameters().add(chair ? Role.REQ_PARTICIPANT : Role.CHAIR);
+ uno.getParameters().add(chair ? Role.CHAIR : Role.REQ_PARTICIPANT);
uno.getParameters().add(new Cn(display));
meeting.getProperties().add(uno);
return this;
diff --git a/openmeetings-web/src/test/java/org/apache/openmeetings/calendar/TestSendIcalMessage.java b/openmeetings-web/src/test/java/org/apache/openmeetings/calendar/TestSendIcalMessage.java
index 1b6926c..429e120 100644
--- a/openmeetings-web/src/test/java/org/apache/openmeetings/calendar/TestSendIcalMessage.java
+++ b/openmeetings-web/src/test/java/org/apache/openmeetings/calendar/TestSendIcalMessage.java
@@ -70,11 +70,12 @@ class TestSendIcalMessage extends AbstractJUnitDefaults {
Date end = endCal.getTime();
IcalHandler handler = new IcalHandler(IcalHandler.ICAL_METHOD_REQUEST)
.createVEvent(TimeZone.getDefault().getID(), start, end, "test event")
- .addOrganizer(recipients, "seba-test")
- .addAttendee(email, username, invitor)
- .setDescription("localhost:5080/link_openmeetings")
.setLocation("")
+ .setDescription("localhost:5080/link_openmeetings")
.setUid(randomUUID().toString())
+ .setSequence(0)
+ .addOrganizer(recipients, "seba-test")
+ .addAttendee(email, username, invitor)
.build();
log.debug("ICS: {}", handler.toString());