From 25f4566c6abfa46e47815f27b4051b204fd1094b Mon Sep 17 00:00:00 2001
From: Richard Alam <ritzalam@gmail.com>
Date: Mon, 9 Apr 2018 14:03:21 -0700
Subject: [PATCH]  - try to display audit window

---
 .../bigbluebutton/main/model/users/UserService.as   |  1 -
 .../src/org/bigbluebutton/air/common/PageEnum.as    |  2 +-
 .../src/org/bigbluebutton/air/main/MainConfig.as    |  3 +++
 .../air/main/commands/UserInactivityTimerCommand.as | 10 +++++-----
 .../commands/UserInactivityTimerResponseCommand.as  |  2 +-
 .../air/main/commands/UserInactivityTimerSignal.as  |  2 +-
 .../air/main/views/LoadingScreenMediator.as         |  6 +++---
 .../air/main/views/PagesNavigatorViewMediator.as    |  1 +
 .../air/main/views/UserInactivityView.as            |  4 ++--
 .../air/main/views/UserInactivityViewMediator.as    | 13 +++++++++++--
 .../air/user/services/IUsersService.as              |  2 +-
 .../air/user/services/UsersMessageReceiver.as       | 13 ++++++-------
 .../air/user/services/UsersMessageSender.as         |  7 ++++---
 .../bigbluebutton/air/user/services/UsersService.as |  4 ++--
 14 files changed, 41 insertions(+), 29 deletions(-)

diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as
index a28b4e8633..970ac101fa 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as
+++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as
@@ -189,7 +189,6 @@ package org.bigbluebutton.main.model.users
 		}
 		
 		public function userInactivityAuditResponse():void {
-			trace("******************** SERVICE SENDING USER INACTIVITY AUDIT RESPONSE ***********************");
 			sender.userInactivityAuditResponse();
 		}
 		
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/common/PageEnum.as b/clients/flash/air-client/src/org/bigbluebutton/air/common/PageEnum.as
index 59bad80a25..cf2ba625d5 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/common/PageEnum.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/common/PageEnum.as
@@ -50,7 +50,7 @@ package org.bigbluebutton.air.common {
 		
 		public static const APPLICATION_SETTINGS:String = "ApplicationSettings";
 		
-		public static const INACTIVITY_VIEW:String = "InactivityView";
+		public static const INACTIVITY_VIEW:String = "UserInactivityView";
 		
 		/**
 		 * Especials
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/main/MainConfig.as b/clients/flash/air-client/src/org/bigbluebutton/air/main/MainConfig.as
index df6e1d5611..64261f1910 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/main/MainConfig.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/main/MainConfig.as
@@ -24,6 +24,8 @@ package org.bigbluebutton.air.main {
 	import org.bigbluebutton.air.main.views.PagesNavigatorViewMediator;
 	import org.bigbluebutton.air.main.views.TopToolbarBase;
 	import org.bigbluebutton.air.main.views.TopToolbarMediator;
+	import org.bigbluebutton.air.main.views.UserInactivityView;
+	import org.bigbluebutton.air.main.views.UserInactivityViewMediator;
 	
 	import robotlegs.bender.extensions.matching.TypeMatcher;
 	import robotlegs.bender.extensions.mediatorMap.api.IMediatorMap;
@@ -62,6 +64,7 @@ package org.bigbluebutton.air.main {
 			mediatorMap.map(ExitView).toMediator(ExitViewMediator);
 			mediatorMap.map(DisconnectView).toMediator(DisconnectViewMediator);
 			mediatorMap.map(MainView).toMediator(MainViewMediator);
+			mediatorMap.map(UserInactivityView).toMediator(UserInactivityViewMediator);
 		}
 		
 		/**
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/main/commands/UserInactivityTimerCommand.as b/clients/flash/air-client/src/org/bigbluebutton/air/main/commands/UserInactivityTimerCommand.as
index 812b36cab6..71ccee1c97 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/main/commands/UserInactivityTimerCommand.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/main/commands/UserInactivityTimerCommand.as
@@ -1,5 +1,6 @@
 package org.bigbluebutton.air.main.commands
 {
+	import org.bigbluebutton.air.common.PageEnum;
 	import org.bigbluebutton.air.main.models.IUISession;
 	
 	import robotlegs.bender.bundles.mvcs.Command;
@@ -9,13 +10,12 @@ package org.bigbluebutton.air.main.commands
 		[Inject]
 		public var uiSession:IUISession
 		
-		public function UserInactivityTimerCommand()
-		{
-			super();
-		}
+		[Inject]
+		public var responseDuration: Number
 		
 		override public function execute():void {
-			trace("RECEIVED INACTIVITY TIMER MESSAGE");
+			trace("RECEIVED INACTIVITY TIMER MESSAGE responseDuration=" + responseDuration);
+			uiSession.pushPage(PageEnum.INACTIVITY_VIEW);
 		}
 	}
 }
\ No newline at end of file
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/main/commands/UserInactivityTimerResponseCommand.as b/clients/flash/air-client/src/org/bigbluebutton/air/main/commands/UserInactivityTimerResponseCommand.as
index 3bfed946c8..c825d1ce69 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/main/commands/UserInactivityTimerResponseCommand.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/main/commands/UserInactivityTimerResponseCommand.as
@@ -16,7 +16,7 @@ package org.bigbluebutton.air.main.commands
 		}
 		
 		override public function execute():void {
-			userService.activityResponse();
+			userService.userInactivityAuditResponse();
 		}
 	}
 }
\ No newline at end of file
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/main/commands/UserInactivityTimerSignal.as b/clients/flash/air-client/src/org/bigbluebutton/air/main/commands/UserInactivityTimerSignal.as
index 02cf730f94..b7fed3947d 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/main/commands/UserInactivityTimerSignal.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/main/commands/UserInactivityTimerSignal.as
@@ -6,7 +6,7 @@ package org.bigbluebutton.air.main.commands
 	{
 		public function UserInactivityTimerSignal()
 		{
-			super();
+			super(Number);
 		}
 	}
 }
\ No newline at end of file
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/main/views/LoadingScreenMediator.as b/clients/flash/air-client/src/org/bigbluebutton/air/main/views/LoadingScreenMediator.as
index 91195cbb36..1e35a69575 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/main/views/LoadingScreenMediator.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/main/views/LoadingScreenMediator.as
@@ -40,11 +40,12 @@ package org.bigbluebutton.air.main.views {
 			// If we are in the Flash Builder debugger the InvokeEvent will never be fired
 			if (Capabilities.isDebugger) {
 				//var url:String = "bigbluebutton://test-install.blindsidenetworks.com/bigbluebutton/api/join?fullName=AIR&meetingID=Demo+Meeting&password=mp&redirect=false&checksum=3fdf56e9915c1031c3ea012b4ec8823cedd7c272";
-				var url:String = "bigbluebutton://test-install.blindsidenetworks.com/bigbluebutton/api/join?fullName=User+2021828&meetingID=Demo+Meeting&password=ap&redirect=true&checksum=8751963df96437c7d435eac8124e4fb3ec147115";
+				//var url:String = "bigbluebutton://test-install.blindsidenetworks.com/bigbluebutton/api/join?fullName=User+2021828&meetingID=Demo+Meeting&password=ap&redirect=true&checksum=8751963df96437c7d435eac8124e4fb3ec147115";
+				var url:String = "bigbluebuttons://ritz-ss.blindside-dev.com/bigbluebutton/api/join?bannerColor=%23FF0000&bannerText=TEST+MEETING&fullName=Mobile&meetingID=mobile-test&password=ap&redirect=false&checksum=a5756401838bf2b8920b062f56f75836456ba18d";
 				joinRoom(url);
 			}
 		}
-		
+				
 		private function onInvokeEvent(invocation:InvokeEvent):void {
 			if (invocation.arguments.length > 0 && !Capabilities.isDebugger) {
 				var url:String = invocation.arguments[0].toString();			
@@ -60,7 +61,6 @@ package org.bigbluebutton.air.main.views {
 					FlexGlobals.topLevelApplication.mainshell.visible = false;
 					uiSession.popPage();
 					uiSession.pushPage(PageEnum.MAIN);
-					
 					joinRoom(url);
 				}
 			} else {
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/main/views/PagesNavigatorViewMediator.as b/clients/flash/air-client/src/org/bigbluebutton/air/main/views/PagesNavigatorViewMediator.as
index 37380a3837..78f044984d 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/main/views/PagesNavigatorViewMediator.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/main/views/PagesNavigatorViewMediator.as
@@ -82,6 +82,7 @@ package org.bigbluebutton.air.main.views {
 			} else if (pageRemoved) {
 				view.popView(transition);
 			} else if (pageName != null && pageName != "") {
+				trace("SWITCHING PAGE to " + pageName);
 				view.pushView(PageEnum.getClassfromName(pageName), null, null, transition);
 			}
 		}
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/main/views/UserInactivityView.as b/clients/flash/air-client/src/org/bigbluebutton/air/main/views/UserInactivityView.as
index 24b27bbd73..679383fe53 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/main/views/UserInactivityView.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/main/views/UserInactivityView.as
@@ -20,7 +20,7 @@ package org.bigbluebutton.air.main.views
 			
 			var messageText:Label = new Label();
 			messageText.percentWidth = 90;
-			messageText.text = "Inacitivty Timer";
+			messageText.text = "Inactivity Timer";
 			messageText.setStyle("textAlign", "center");
 			messageText.styleName = "disconnectMessage";
 			addElement(messageText);
@@ -33,7 +33,7 @@ package org.bigbluebutton.air.main.views
 		
 		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
 			super.updateDisplayList(unscaledWidth, unscaledHeight);
-			
+			trace("*************** UserInactivityView updateDisplayList w=" + unscaledWidth + " h=" + unscaledHeight + "*************");
 			this.layout["gap"] = getStyle("gap");
 			this.layout["padding"] = getStyle("padding");
 		}
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/main/views/UserInactivityViewMediator.as b/clients/flash/air-client/src/org/bigbluebutton/air/main/views/UserInactivityViewMediator.as
index 2e5e44a2ff..6acf1cffe5 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/main/views/UserInactivityViewMediator.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/main/views/UserInactivityViewMediator.as
@@ -4,8 +4,17 @@ package org.bigbluebutton.air.main.views
 
 	public class UserInactivityViewMediator extends Mediator
 	{
-		public function UserInactivityViewMediator()
-		{
+		[Inject]
+		public var view:UserInactivityView;
+		
+		
+		override public function initialize():void {
+			trace("************ UserInactivityView:: INIT **************");
+			view.okButton.visible = true;
+		}
+		
+		override public function destroy():void {
+			trace("************ UserInactivityView:: destroy **************");
 		}
 	}
 }
\ No newline at end of file
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/user/services/IUsersService.as b/clients/flash/air-client/src/org/bigbluebutton/air/user/services/IUsersService.as
index dc91da3ed0..ef0ad6b666 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/user/services/IUsersService.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/user/services/IUsersService.as
@@ -23,6 +23,6 @@ package org.bigbluebutton.air.user.services {
 		function validateToken():void;
 		function joinMeeting():void;
 		function changeRole(userId:String, role:String):void;
-		function activityResponse():void;
+		function userInactivityAuditResponse():void;
 	}
 }
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/user/services/UsersMessageReceiver.as b/clients/flash/air-client/src/org/bigbluebutton/air/user/services/UsersMessageReceiver.as
index 31f6c5107a..b1a2fd537c 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/user/services/UsersMessageReceiver.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/user/services/UsersMessageReceiver.as
@@ -97,20 +97,19 @@ package org.bigbluebutton.air.user.services {
 				case "UserRoleChangedEvtMsg":
 					handleUserRoleChangedEvtMsg(message);
 					break;
-				case "MeetingInactivityWarningEvtMsg":
-					handleInactivityWarning(message);
+				case "UserInactivityAuditMsg":
+					handleUserInactivityAuditMsg(message);
 					break;
 				default:
 					break;
 			}
 		}
 		
-		private function handleInactivityWarning(m:Object):void {
-			var msg:Object = JSON.parse(m.msg);
-			trace("handleInactivityWarning: " + ObjectUtil.toString(msg));
-			meetingInactivityTimerSignal.dispatch();
+		private function handleUserInactivityAuditMsg(m:Object):void {
+			trace("handleInactivityWarning: " + ObjectUtil.toString(m));
+			meetingInactivityTimerSignal.dispatch(m.body.responseDuration as Number);
 		}
-		
+				
 		private function handleMeetingMuted(m:Object):void {
 			var msg:Object = JSON.parse(m.msg);
 			trace("handleMeetingMuted: " + ObjectUtil.toString(msg));
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/user/services/UsersMessageSender.as b/clients/flash/air-client/src/org/bigbluebutton/air/user/services/UsersMessageSender.as
index cbd6bb265e..20f059643f 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/user/services/UsersMessageSender.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/user/services/UsersMessageSender.as
@@ -232,12 +232,13 @@ package org.bigbluebutton.air.user.services {
 			userSession.mainConnection.sendMessage2x(defaultSuccessResponse, defaultFailureResponse, message);
 		}
 		
-		public function activityResponse():void {
+		public function userInactivityAuditResponse():void {
 			var message:Object = {
-				header: {name: "MeetingActivityResponseCmdMsg", meetingId: conferenceParameters.meetingID, 
+				header: {name: "UserInactivityAuditResponseMsg", meetingId: conferenceParameters.meetingID, 
 					userId: conferenceParameters.internalUserID},
-				body: {respondedBy: conferenceParameters.internalUserID}
+				body: {userId: conferenceParameters.internalUserID}
 			};
+			
 			userSession.mainConnection.sendMessage2x(defaultSuccessResponse, defaultFailureResponse, message);
 		}
 	}
diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/user/services/UsersService.as b/clients/flash/air-client/src/org/bigbluebutton/air/user/services/UsersService.as
index c38cf95d6b..eb2e3340b7 100755
--- a/clients/flash/air-client/src/org/bigbluebutton/air/user/services/UsersService.as
+++ b/clients/flash/air-client/src/org/bigbluebutton/air/user/services/UsersService.as
@@ -143,8 +143,8 @@ package org.bigbluebutton.air.user.services {
 			usersMessageSender.changeRole(userId, role);
 		}
 	
-		public function activityResponse():void {
-			usersMessageSender.activityResponse();
+		public function userInactivityAuditResponse():void {
+			usersMessageSender.userInactivityAuditResponse();
 		}
 	}
 }
-- 
GitLab