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 2015/02/11 12:52:52 UTC

svn commit: r1658936 - in /openmeetings: branches/3.0.x/src/main/java/org/apache/openmeetings/remote/UserService.java trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java

Author: solomax
Date: Wed Feb 11 11:52:51 2015
New Revision: 1658936

URL: http://svn.apache.org/r1658936
Log:
[OPENMEETINGS-1175] correct email is being sent on private message

Modified:
    openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/UserService.java
    openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java

Modified: openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/UserService.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/UserService.java?rev=1658936&r1=1658935&r2=1658936&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/UserService.java (original)
+++ openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/UserService.java Wed Feb 11 11:52:51 2015
@@ -117,7 +117,7 @@ public class UserService implements IUse
 	@Autowired
 	private SlaveHTTPConnectionManager slaveHTTPConnectionManager;
 	@Autowired
-	private FieldLanguagesValuesDao fieldLanguagesValuesDao;
+	private FieldLanguagesValuesDao labelDao;
 	@Autowired
 	private RoomTypeDao roomTypeDao;
 
@@ -195,11 +195,8 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// admins only
 			if (AuthLevelUtil.hasAdminLevel(userDao.getRights(users_id))) {
-
 				if (serverId == 0) {
-
-					Client rcl = this.sessionManager
-							.getClientByStreamId(streamid, null);
+					Client rcl = sessionManager.getClientByStreamId(streamid, null);
 
 					if (rcl == null) {
 						return true;
@@ -208,21 +205,16 @@ public class UserService implements IUse
 					if (rcl.getRoom_id() != null) {
 						scopeName = rcl.getRoom_id().toString();
 					}
-					IScope currentScope = this.scopeApplicationAdapter
-							.getRoomScope(scopeName);
+					IScope currentScope = scopeApplicationAdapter.getRoomScope(scopeName);
 
 					HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
 					messageObj.put(0, "kick");
-					this.scopeApplicationAdapter.sendMessageById(messageObj,
-							streamid, currentScope);
+					scopeApplicationAdapter.sendMessageById(messageObj, streamid, currentScope);
 
-					this.scopeApplicationAdapter.roomLeaveByScope(rcl,
-							currentScope, true);
+					scopeApplicationAdapter.roomLeaveByScope(rcl, currentScope, true);
 
 					return true;
-
 				} else {
-
 					Server server = serverDao.get(serverId);
 					Client rcl = sessionManager.getClientByStreamId(
 							streamid, server);
@@ -245,7 +237,6 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
 				User us = userDao.get(users_id);
 
 				us.setTimeZoneId(timezoneUtil.getTimezoneByInternalJName(jname).getID());
@@ -255,7 +246,6 @@ public class UserService implements IUse
 				userDao.update(us, users_id);
 				
 				return us;
-
 			}
 		} catch (Exception err) {
 			log.error("[updateUserTimeZone]", err);
@@ -283,13 +273,10 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
-				List<UserContact> uList = userContactsDao
-						.getContactRequestsByUserAndStatus(users_id, true);
+				List<UserContact> uList = userContactsDao.getContactRequestsByUserAndStatus(users_id, true);
 
 				return uList;
 			}
-
 		} catch (Exception err) {
 			log.error("[getPendingUserContact]", err);
 		}
@@ -301,13 +288,10 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
-				List<UserContact> uList = userContactsDao
-						.getContactsByUserAndStatus(users_id, false);
+				List<UserContact> uList = userContactsDao.getContactsByUserAndStatus(users_id, false);
 
 				return uList;
 			}
-
 		} catch (Exception err) {
 			log.error("[getPendingUserContact]", err);
 		}
@@ -319,16 +303,13 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
-				UserContact userContacts = userContactsDao
-						.get(userContactId);
+				UserContact userContacts = userContactsDao.get(userContactId);
 
 				if (userContacts == null) {
 					return -49;
 				}
 
 				return userContactsDao.deleteUserContact(userContactId);
-
 			}
 		} catch (Exception err) {
 			log.error("[removeContactUser]", err);
@@ -359,7 +340,6 @@ public class UserService implements IUse
 			String validToTime, Long parentMessageId, Long roomtype_id,
 			String domain, String port, String webapp) {
 		try {
-
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
@@ -424,10 +404,10 @@ public class UserService implements IUse
 					if (to.getAdresses() != null) {
 						AbstractTemplatePanel.ensureApplication(from.getLanguage_id());
 						String aLinkHTML = 	"<br/><br/>" + "<a href='" + ContactsHelper.getLink() + "'>"
-									+  fieldLanguagesValuesDao.get(1302, from.getLanguage_id()) + "</a><br/>";
+									+  labelDao.getString(1302, from.getLanguage_id()) + "</a><br/>";
 						
 						mailHandler.send(to.getAdresses().getEmail(),
-								fieldLanguagesValuesDao.get(1301, from.getLanguage_id()) + subject,
+								labelDao.getString(1301, from.getLanguage_id()) + subject,
 								message.replaceAll("\\<.*?>", "") + aLinkHTML);
 					}
 				}
@@ -444,45 +424,34 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
-				List<UserContact> uList = userContactsDao
-						.getContactsByUserAndStatus(users_id, false);
+				List<UserContact> uList = userContactsDao.getContactsByUserAndStatus(users_id, false);
 
 				for (UserContact userContact : uList) {
-
 					if (userContact.getContact().getUser_id().equals(user_id)) {
 						return true;
 					}
-
 				}
 
 				return false;
-
 			}
-
 		} catch (Exception err) {
 			log.error("[checkUserIsInContactList]", err);
 		}
 		return null;
 	}
 
-	public void shareCalendarUserContact(String SID, Long userContactId,
-			Boolean shareCalendar) {
+	public void shareCalendarUserContact(String SID, Long userContactId, Boolean shareCalendar) {
 		try {
 			Long users_id = sessiondataDao.checkSession(SID);
 
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
-				UserContact userContacts = userContactsDao
-						.get(userContactId);
+				UserContact userContacts = userContactsDao.get(userContactId);
 
 				userContacts.setShareCalendar(shareCalendar);
 
 				userContactsDao.updateContact(userContacts);
-
 			}
-
 		} catch (Exception err) {
 			log.error("[shareCalendarUserContact]", err);
 		}
@@ -505,9 +474,7 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
-				Client rcl = this.sessionManager.getClientByPublicSID(
-						publicSID, false, null);
+				Client rcl = sessionManager.getClientByPublicSID(publicSID, false, null);
 
 				if (rcl == null) {
 					return true;
@@ -522,15 +489,11 @@ public class UserService implements IUse
 				HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
 				messageObj.put(0, "kick");
 
-				this.scopeApplicationAdapter.sendMessageById(messageObj,
-						rcl.getStreamid(), currentScope);
-
-				this.scopeApplicationAdapter.roomLeaveByScope(rcl,
-						currentScope, true);
+				scopeApplicationAdapter.sendMessageById(messageObj, rcl.getStreamid(), currentScope);
+				scopeApplicationAdapter.roomLeaveByScope(rcl, currentScope, true);
 
 				return true;
 			}
-
 		} catch (Exception err) {
 			log.error("[kickUserByStreamId]", err);
 		}

Modified: openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java?rev=1658936&r1=1658935&r2=1658936&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java (original)
+++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java Wed Feb 11 11:52:51 2015
@@ -63,7 +63,6 @@ import org.springframework.beans.factory
  * 
  */
 public class UserService implements IUserService {
-
 	private static final Logger log = Red5LoggerFactory.getLogger(UserService.class, webAppRootKey);
 
 	@Autowired
@@ -105,7 +104,7 @@ public class UserService implements IUse
 	@Autowired
 	private ISlaveHTTPConnectionManager slaveHTTPConnectionManager;
 	@Autowired
-	private FieldLanguagesValuesDao fieldLanguagesValuesDao;
+	private FieldLanguagesValuesDao labelDao;
 	@Autowired
 	private RoomTypeDao roomTypeDao;
 
@@ -167,11 +166,8 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// admins only
 			if (AuthLevelUtil.hasAdminLevel(userDao.getRights(users_id))) {
-
 				if (serverId == 0) {
-
-					Client rcl = this.sessionManager
-							.getClientByStreamId(streamid, null);
+					Client rcl = sessionManager.getClientByStreamId(streamid, null);
 
 					if (rcl == null) {
 						return true;
@@ -180,21 +176,16 @@ public class UserService implements IUse
 					if (rcl.getRoom_id() != null) {
 						scopeName = rcl.getRoom_id().toString();
 					}
-					IScope currentScope = this.scopeApplicationAdapter
-							.getRoomScope(scopeName);
+					IScope currentScope = scopeApplicationAdapter.getRoomScope(scopeName);
 
 					HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
 					messageObj.put(0, "kick");
-					this.scopeApplicationAdapter.sendMessageById(messageObj,
-							streamid, currentScope);
+					scopeApplicationAdapter.sendMessageById(messageObj, streamid, currentScope);
 
-					this.scopeApplicationAdapter.roomLeaveByScope(rcl,
-							currentScope, true);
+					scopeApplicationAdapter.roomLeaveByScope(rcl, currentScope, true);
 
 					return true;
-
 				} else {
-
 					Server server = serverDao.get(serverId);
 					Client rcl = sessionManager.getClientByStreamId(
 							streamid, server);
@@ -217,7 +208,6 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
 				User us = userDao.get(users_id);
 
 				us.setTimeZoneId(timezoneUtil.getTimezoneByInternalJName(jname).getID());
@@ -227,7 +217,6 @@ public class UserService implements IUse
 				userDao.update(us, users_id);
 				
 				return us;
-
 			}
 		} catch (Exception err) {
 			log.error("[updateUserTimeZone]", err);
@@ -240,13 +229,10 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
-				List<UserContact> uList = userContactsDao
-						.getContactRequestsByUserAndStatus(users_id, true);
+				List<UserContact> uList = userContactsDao.getContactRequestsByUserAndStatus(users_id, true);
 
 				return uList;
 			}
-
 		} catch (Exception err) {
 			log.error("[getPendingUserContact]", err);
 		}
@@ -258,13 +244,10 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
-				List<UserContact> uList = userContactsDao
-						.getContactsByUserAndStatus(users_id, false);
+				List<UserContact> uList = userContactsDao.getContactsByUserAndStatus(users_id, false);
 
 				return uList;
 			}
-
 		} catch (Exception err) {
 			log.error("[getPendingUserContact]", err);
 		}
@@ -276,16 +259,13 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
-				UserContact userContacts = userContactsDao
-						.get(userContactId);
+				UserContact userContacts = userContactsDao.get(userContactId);
 
 				if (userContacts == null) {
 					return -49;
 				}
 
 				return userContactsDao.deleteUserContact(userContactId);
-
 			}
 		} catch (Exception err) {
 			log.error("[removeContactUser]", err);
@@ -298,45 +278,34 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
-				List<UserContact> uList = userContactsDao
-						.getContactsByUserAndStatus(users_id, false);
+				List<UserContact> uList = userContactsDao.getContactsByUserAndStatus(users_id, false);
 
 				for (UserContact userContact : uList) {
-
 					if (userContact.getContact().getId().equals(user_id)) {
 						return true;
 					}
-
 				}
 
 				return false;
-
 			}
-
 		} catch (Exception err) {
 			log.error("[checkUserIsInContactList]", err);
 		}
 		return null;
 	}
 
-	public void shareCalendarUserContact(String SID, Long userContactId,
-			Boolean shareCalendar) {
+	public void shareCalendarUserContact(String SID, Long userContactId, Boolean shareCalendar) {
 		try {
 			Long users_id = sessiondataDao.checkSession(SID);
 
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
-				UserContact userContacts = userContactsDao
-						.get(userContactId);
+				UserContact userContacts = userContactsDao.get(userContactId);
 
 				userContacts.setShareCalendar(shareCalendar);
 
 				userContactsDao.updateContact(userContacts);
-
 			}
-
 		} catch (Exception err) {
 			log.error("[shareCalendarUserContact]", err);
 		}
@@ -359,9 +328,7 @@ public class UserService implements IUse
 			Long users_id = sessiondataDao.checkSession(SID);
 			// users only
 			if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-
-				Client rcl = this.sessionManager.getClientByPublicSID(
-						publicSID, false, null);
+				Client rcl = sessionManager.getClientByPublicSID(publicSID, false, null);
 
 				if (rcl == null) {
 					return true;
@@ -376,15 +343,11 @@ public class UserService implements IUse
 				HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
 				messageObj.put(0, "kick");
 
-				this.scopeApplicationAdapter.sendMessageById(messageObj,
-						rcl.getStreamid(), currentScope);
-
-				this.scopeApplicationAdapter.roomLeaveByScope(rcl,
-						currentScope, true);
+				scopeApplicationAdapter.sendMessageById(messageObj, rcl.getStreamid(), currentScope);
+				scopeApplicationAdapter.roomLeaveByScope(rcl, currentScope, true);
 
 				return true;
 			}
-
 		} catch (Exception err) {
 			log.error("[kickUserByStreamId]", err);
 		}