[openmeetings] branch master updated: [OPENMEETINGS-2480] appointment invitation links are fixed

2020-10-15 Thread solomax
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 00fd257  [OPENMEETINGS-2480] appointment invitation links are fixed
00fd257 is described below

commit 00fd25771ba428035eaea83645f5d8c5386143ab
Author: Maxim Solodovnik 
AuthorDate: Thu Oct 15 18:48:08 2020 +0700

[OPENMEETINGS-2480] appointment invitation links are fixed
---
 .../db/dao/calendar/AppointmentDao.java | 21 +++--
 1 file changed, 11 insertions(+), 10 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 10c91dc..474df5d 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
@@ -99,11 +99,19 @@ public class AppointmentDao implements 
IDataProviderDao{

r.setCapacity(cfgDao.getLong(CONFIG_CALENDAR_ROOM_CAPACITY, 50L));
}
a.setRoom(roomDao.update(r, userId));
+   final boolean newApp = a.getId() == null;
+   if (newApp) {
+   a.setInserted(new Date());
+   em.persist(a);
+   } else {
+   a.setUpdated(new Date());
+   a = em.merge(a);
+   }
if (sendmails) {
-   Set mmIds = a.getId() == null ? new HashSet<>()
+   Set mmIds = newApp ? new HashSet<>()
: 
meetingMemberDao.getMeetingMemberIdsByAppointment(a.getId());
// update meeting members
-   Appointment a0 = a.getId() == null ? null : 
get(a.getId());
+   Appointment a0 = newApp ? null : get(a.getId());
boolean sendMail = a0 == null || 
!a0.getTitle().equals(a.getTitle()) ||
!(a0.getDescription() != null ? 
a0.getDescription().equals(a.getDescription()) : true) ||
!(a0.getLocation() != null ? 
a0.getLocation().equals(a.getLocation()) : true) ||
@@ -126,7 +134,7 @@ public class AppointmentDao implements 
IDataProviderDao{
//notify owner
MeetingMember owner = new MeetingMember();
owner.setUser(a.getOwner());
-   if (a.getId() == null) {
+   if (newApp) {
invitationManager.processInvitation(a, owner, 
MessageType.CREATE);
} else if (a.isDeleted()) {
invitationManager.processInvitation(a, owner, 
MessageType.CANCEL);
@@ -134,13 +142,6 @@ public class AppointmentDao implements 
IDataProviderDao{
invitationManager.processInvitation(a, owner, 
MessageType.UPDATE, sendMail);
}
}
-   if (a.getId() == null) {
-   a.setInserted(new Date());
-   em.persist(a);
-   } else {
-   a.setUpdated(new Date());
-   a = em.merge(a);
-   }
return a;
}
 



[openmeetings] branch master updated: [OPENMEETINGS-2480] appointment invitation links are fixed

2020-10-15 Thread solomax
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 00fd257  [OPENMEETINGS-2480] appointment invitation links are fixed
00fd257 is described below

commit 00fd25771ba428035eaea83645f5d8c5386143ab
Author: Maxim Solodovnik 
AuthorDate: Thu Oct 15 18:48:08 2020 +0700

[OPENMEETINGS-2480] appointment invitation links are fixed
---
 .../db/dao/calendar/AppointmentDao.java | 21 +++--
 1 file changed, 11 insertions(+), 10 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 10c91dc..474df5d 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
@@ -99,11 +99,19 @@ public class AppointmentDao implements 
IDataProviderDao{

r.setCapacity(cfgDao.getLong(CONFIG_CALENDAR_ROOM_CAPACITY, 50L));
}
a.setRoom(roomDao.update(r, userId));
+   final boolean newApp = a.getId() == null;
+   if (newApp) {
+   a.setInserted(new Date());
+   em.persist(a);
+   } else {
+   a.setUpdated(new Date());
+   a = em.merge(a);
+   }
if (sendmails) {
-   Set mmIds = a.getId() == null ? new HashSet<>()
+   Set mmIds = newApp ? new HashSet<>()
: 
meetingMemberDao.getMeetingMemberIdsByAppointment(a.getId());
// update meeting members
-   Appointment a0 = a.getId() == null ? null : 
get(a.getId());
+   Appointment a0 = newApp ? null : get(a.getId());
boolean sendMail = a0 == null || 
!a0.getTitle().equals(a.getTitle()) ||
!(a0.getDescription() != null ? 
a0.getDescription().equals(a.getDescription()) : true) ||
!(a0.getLocation() != null ? 
a0.getLocation().equals(a.getLocation()) : true) ||
@@ -126,7 +134,7 @@ public class AppointmentDao implements 
IDataProviderDao{
//notify owner
MeetingMember owner = new MeetingMember();
owner.setUser(a.getOwner());
-   if (a.getId() == null) {
+   if (newApp) {
invitationManager.processInvitation(a, owner, 
MessageType.CREATE);
} else if (a.isDeleted()) {
invitationManager.processInvitation(a, owner, 
MessageType.CANCEL);
@@ -134,13 +142,6 @@ public class AppointmentDao implements 
IDataProviderDao{
invitationManager.processInvitation(a, owner, 
MessageType.UPDATE, sendMail);
}
}
-   if (a.getId() == null) {
-   a.setInserted(new Date());
-   em.persist(a);
-   } else {
-   a.setUpdated(new Date());
-   a = em.merge(a);
-   }
return a;
}
 



[openmeetings] branch master updated: [OPENMEETINGS-2480] appointment invitation links are fixed

2020-10-15 Thread solomax
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 00fd257  [OPENMEETINGS-2480] appointment invitation links are fixed
00fd257 is described below

commit 00fd25771ba428035eaea83645f5d8c5386143ab
Author: Maxim Solodovnik 
AuthorDate: Thu Oct 15 18:48:08 2020 +0700

[OPENMEETINGS-2480] appointment invitation links are fixed
---
 .../db/dao/calendar/AppointmentDao.java | 21 +++--
 1 file changed, 11 insertions(+), 10 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 10c91dc..474df5d 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
@@ -99,11 +99,19 @@ public class AppointmentDao implements 
IDataProviderDao{

r.setCapacity(cfgDao.getLong(CONFIG_CALENDAR_ROOM_CAPACITY, 50L));
}
a.setRoom(roomDao.update(r, userId));
+   final boolean newApp = a.getId() == null;
+   if (newApp) {
+   a.setInserted(new Date());
+   em.persist(a);
+   } else {
+   a.setUpdated(new Date());
+   a = em.merge(a);
+   }
if (sendmails) {
-   Set mmIds = a.getId() == null ? new HashSet<>()
+   Set mmIds = newApp ? new HashSet<>()
: 
meetingMemberDao.getMeetingMemberIdsByAppointment(a.getId());
// update meeting members
-   Appointment a0 = a.getId() == null ? null : 
get(a.getId());
+   Appointment a0 = newApp ? null : get(a.getId());
boolean sendMail = a0 == null || 
!a0.getTitle().equals(a.getTitle()) ||
!(a0.getDescription() != null ? 
a0.getDescription().equals(a.getDescription()) : true) ||
!(a0.getLocation() != null ? 
a0.getLocation().equals(a.getLocation()) : true) ||
@@ -126,7 +134,7 @@ public class AppointmentDao implements 
IDataProviderDao{
//notify owner
MeetingMember owner = new MeetingMember();
owner.setUser(a.getOwner());
-   if (a.getId() == null) {
+   if (newApp) {
invitationManager.processInvitation(a, owner, 
MessageType.CREATE);
} else if (a.isDeleted()) {
invitationManager.processInvitation(a, owner, 
MessageType.CANCEL);
@@ -134,13 +142,6 @@ public class AppointmentDao implements 
IDataProviderDao{
invitationManager.processInvitation(a, owner, 
MessageType.UPDATE, sendMail);
}
}
-   if (a.getId() == null) {
-   a.setInserted(new Date());
-   em.persist(a);
-   } else {
-   a.setUpdated(new Date());
-   a = em.merge(a);
-   }
return a;
}
 



[openmeetings] branch master updated: [OPENMEETINGS-2480] appointment invitation links are fixed

2020-10-15 Thread solomax
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 00fd257  [OPENMEETINGS-2480] appointment invitation links are fixed
00fd257 is described below

commit 00fd25771ba428035eaea83645f5d8c5386143ab
Author: Maxim Solodovnik 
AuthorDate: Thu Oct 15 18:48:08 2020 +0700

[OPENMEETINGS-2480] appointment invitation links are fixed
---
 .../db/dao/calendar/AppointmentDao.java | 21 +++--
 1 file changed, 11 insertions(+), 10 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 10c91dc..474df5d 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
@@ -99,11 +99,19 @@ public class AppointmentDao implements 
IDataProviderDao{

r.setCapacity(cfgDao.getLong(CONFIG_CALENDAR_ROOM_CAPACITY, 50L));
}
a.setRoom(roomDao.update(r, userId));
+   final boolean newApp = a.getId() == null;
+   if (newApp) {
+   a.setInserted(new Date());
+   em.persist(a);
+   } else {
+   a.setUpdated(new Date());
+   a = em.merge(a);
+   }
if (sendmails) {
-   Set mmIds = a.getId() == null ? new HashSet<>()
+   Set mmIds = newApp ? new HashSet<>()
: 
meetingMemberDao.getMeetingMemberIdsByAppointment(a.getId());
// update meeting members
-   Appointment a0 = a.getId() == null ? null : 
get(a.getId());
+   Appointment a0 = newApp ? null : get(a.getId());
boolean sendMail = a0 == null || 
!a0.getTitle().equals(a.getTitle()) ||
!(a0.getDescription() != null ? 
a0.getDescription().equals(a.getDescription()) : true) ||
!(a0.getLocation() != null ? 
a0.getLocation().equals(a.getLocation()) : true) ||
@@ -126,7 +134,7 @@ public class AppointmentDao implements 
IDataProviderDao{
//notify owner
MeetingMember owner = new MeetingMember();
owner.setUser(a.getOwner());
-   if (a.getId() == null) {
+   if (newApp) {
invitationManager.processInvitation(a, owner, 
MessageType.CREATE);
} else if (a.isDeleted()) {
invitationManager.processInvitation(a, owner, 
MessageType.CANCEL);
@@ -134,13 +142,6 @@ public class AppointmentDao implements 
IDataProviderDao{
invitationManager.processInvitation(a, owner, 
MessageType.UPDATE, sendMail);
}
}
-   if (a.getId() == null) {
-   a.setInserted(new Date());
-   em.persist(a);
-   } else {
-   a.setUpdated(new Date());
-   a = em.merge(a);
-   }
return a;
}