diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/ChatCopyEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/ChatCopyEvent.as old mode 100644 new mode 100755 index be0906e8a9..e50b65502f --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/ChatCopyEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/ChatCopyEvent.as @@ -1,17 +1,16 @@ package org.bigbluebutton.modules.chat.events { import flash.events.Event; - import org.bigbluebutton.modules.chat.model.ChatConversation; public class ChatCopyEvent extends Event { public static const COPY_CHAT_EVENT:String = 'COPY_CHAT_EVENT'; - public var chatMessages:ChatConversation; + public var chatId:String; - public function ChatCopyEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false) + public function ChatCopyEvent(type:String) { - super(type, bubbles, cancelable); + super(type, true, false); } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/ChatHistoryEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/ChatHistoryEvent.as index 4cb4fb111e..d2e33bdc68 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/ChatHistoryEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/ChatHistoryEvent.as @@ -25,11 +25,11 @@ package org.bigbluebutton.modules.chat.events public static const REQUEST_HISTORY:String = "REQUEST_HISTORY"; public static const RECEIVED_HISTORY:String = 'RECEIVED_HISTORY'; - public var history:Array; + public var chatId:String; - public function ChatHistoryEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false) + public function ChatHistoryEvent(type:String) { - super(type, bubbles, cancelable); + super(type, true, false); } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/ChatSaveEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/ChatSaveEvent.as old mode 100644 new mode 100755 index 30cf4f3684..728c441ee8 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/ChatSaveEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/ChatSaveEvent.as @@ -1,18 +1,17 @@ package org.bigbluebutton.modules.chat.events { import flash.events.Event; - import org.bigbluebutton.modules.chat.model.ChatConversation; public class ChatSaveEvent extends Event { public static const SAVE_CHAT_EVENT:String = 'SAVE_CHAT_EVENT'; - public var chatMessages:ChatConversation; + public var chatId: String; public var filename:String; - public function ChatSaveEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false) + public function ChatSaveEvent(type:String) { - super(type, bubbles, cancelable); + super(type, true, false); } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/PublicChatMessageEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/PublicChatMessageEvent.as index b19fd4ff90..fb83f9016e 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/PublicChatMessageEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/events/PublicChatMessageEvent.as @@ -20,17 +20,16 @@ package org.bigbluebutton.modules.chat.events { import flash.events.Event; - import org.bigbluebutton.modules.chat.vo.ChatMessageVO; - public class PublicChatMessageEvent extends Event { public static const PUBLIC_CHAT_MESSAGE_EVENT:String = 'PUBLIC_CHAT_MESSAGE_EVENT'; - public var message:ChatMessageVO; - + public var id:String; + public var senderId: String; + public function PublicChatMessageEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false) { - super(type, bubbles, cancelable); + super(type, true, false); } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/model/ChatConversation.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/model/ChatConversation.as index 9432325e58..fe42427ff7 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/model/ChatConversation.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/model/ChatConversation.as @@ -19,25 +19,23 @@ package org.bigbluebutton.modules.chat.model { import com.adobe.utils.StringUtil; - import com.asfusion.mate.events.Dispatcher; - - import flash.system.Capabilities; - + import com.asfusion.mate.events.Dispatcher; + import flash.system.Capabilities; import mx.collections.ArrayCollection; - import org.bigbluebutton.modules.chat.ChatUtil; import org.bigbluebutton.modules.chat.events.ChatHistoryEvent; + import org.bigbluebutton.modules.chat.events.PublicChatMessageEvent; import org.bigbluebutton.modules.chat.vo.ChatMessageVO; import org.bigbluebutton.util.i18n.ResourceUtil; - + public class ChatConversation { - + private var _dispatcher:Dispatcher = new Dispatcher(); - + [Bindable] public var messages:ArrayCollection = new ArrayCollection(); - + private var id: String; public function ChatConversation(id: String) { @@ -51,29 +49,36 @@ package org.bigbluebutton.modules.chat.model public function numMessages():int { return messages.length; } - + public function newChatMessage(msg:ChatMessageVO):void { var newCM:ChatMessage = convertChatMessage(msg); - if (messages.length > 0) { - var previousCM:ChatMessage = messages.getItemAt(messages.length-1) as ChatMessage; - newCM.lastSenderId = previousCM.senderId; - newCM.lastTime = previousCM.time; - } - messages.addItem(newCM); + if (messages.length > 0) { + var previousCM:ChatMessage = messages.getItemAt(messages.length-1) as ChatMessage; + newCM.lastSenderId = previousCM.senderId; + newCM.lastTime = previousCM.time; + } + messages.addItem(newCM); + trace("NUM MESSAGES = " + messages.length); + + var pcEvent:PublicChatMessageEvent = new PublicChatMessageEvent(PublicChatMessageEvent.PUBLIC_CHAT_MESSAGE_EVENT); + pcEvent.id = id; + pcEvent.senderId = newCM.senderId; + _dispatcher.dispatchEvent(pcEvent); + } public function processChatHistory(messageVOs:Array):void { if (messageVOs.length > 0) { var previousCM:ChatMessage = convertChatMessage(messageVOs[0] as ChatMessageVO);; - var newCM:ChatMessage; - messages.addItemAt(previousCM, 0); - + var newCM:ChatMessage; + messages.addItemAt(previousCM, 0); + for (var i:int=1; i < messageVOs.length; i++) { newCM = convertChatMessage(messageVOs[i] as ChatMessageVO); - newCM.lastSenderId = previousCM.senderId; - newCM.lastTime = previousCM.time; - messages.addItemAt(newCM, i); - previousCM = newCM; + newCM.lastSenderId = previousCM.senderId; + newCM.lastTime = previousCM.time; + messages.addItemAt(newCM, i); + previousCM = newCM; } if (messageVOs.length < messages.length) { @@ -82,36 +87,40 @@ package org.bigbluebutton.modules.chat.model newCM.lastTime = previousCM.time; } } + + var chEvent:ChatHistoryEvent = new ChatHistoryEvent(ChatHistoryEvent.RECEIVED_HISTORY); + chEvent.chatId = id; + _dispatcher.dispatchEvent(chEvent); } private function convertChatMessage(msgVO:ChatMessageVO):ChatMessage { - var cm:ChatMessage = new ChatMessage(); - - cm.lastSenderId = ""; - cm.lastTime = ""; - - cm.senderId = msgVO.fromUserId; - - cm.text = msgVO.message; - - cm.name = msgVO.fromUsername; - cm.senderColor = uint(msgVO.fromColor); - - // Welcome message will skip time - if (msgVO.fromTime != -1) { - cm.fromTime = msgVO.fromTime; - cm.fromTimezoneOffset = msgVO.fromTimezoneOffset; - cm.time = convertTimeNumberToString(msgVO.fromTime); - } - return cm + var cm:ChatMessage = new ChatMessage(); + + cm.lastSenderId = ""; + cm.lastTime = ""; + + cm.senderId = msgVO.fromUserId; + + cm.text = msgVO.message; + + cm.name = msgVO.fromUsername; + cm.senderColor = uint(msgVO.fromColor); + + // Welcome message will skip time + if (msgVO.fromTime != -1) { + cm.fromTime = msgVO.fromTime; + cm.fromTimezoneOffset = msgVO.fromTimezoneOffset; + cm.time = convertTimeNumberToString(msgVO.fromTime); + } + return cm + } + + private function convertTimeNumberToString(time:Number):String { + var sentTime:Date = new Date(); + sentTime.setTime(time); + return ChatUtil.getHours(sentTime) + ":" + ChatUtil.getMinutes(sentTime); } - private function convertTimeNumberToString(time:Number):String { - var sentTime:Date = new Date(); - sentTime.setTime(time); - return ChatUtil.getHours(sentTime) + ":" + ChatUtil.getMinutes(sentTime); - } - public function getAllMessageAsString():String{ var allText:String = ""; var returnStr:String = (Capabilities.os.indexOf("Windows") >= 0 ? "\r\n" : "\n"); @@ -125,17 +134,17 @@ package org.bigbluebutton.modules.chat.model } return allText; } - + public function clearPublicChat():void { var cm:ChatMessage = new ChatMessage(); cm.time = convertTimeNumberToString(new Date().time); cm.text = ""+ResourceUtil.getInstance().getString('bbb.chat.clearBtn.chatMessage')+""; cm.name = ""; cm.senderColor = uint(0x000000); - + messages.removeAll(); messages.addItem(cm); - + var welcomeEvent:ChatHistoryEvent = new ChatHistoryEvent(ChatHistoryEvent.RECEIVED_HISTORY); _dispatcher.dispatchEvent(welcomeEvent); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/model/ChatModel.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/model/ChatModel.as index 1caf0248e6..de33e2f0ec 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/model/ChatModel.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/model/ChatModel.as @@ -43,9 +43,15 @@ package org.bigbluebutton.modules.chat.model public function getChatConversation(convId:String):ChatConversation { if (convs.hasOwnProperty(convId)) { + trace("FOUND chatId = " + convId); return convs[convId]; + } else { + trace("NOT FOUND chatId = " + convId); + var conv: ChatConversation = new ChatConversation(convId); + convs[convId] = conv; + return conv; } - return new ChatConversation(convId); + } } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatCopy.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatCopy.as old mode 100644 new mode 100755 index e1a0747189..b7ea039b45 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatCopy.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatCopy.as @@ -1,17 +1,19 @@ package org.bigbluebutton.modules.chat.services { import flash.system.System; - + import mx.controls.Alert; - - import org.bigbluebutton.modules.chat.model.ChatConversation; + + import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.modules.chat.events.ChatCopyEvent; - import org.bigbluebutton.util.i18n.ResourceUtil; + import org.bigbluebutton.modules.chat.model.ChatConversation; + import org.bigbluebutton.util.i18n.ResourceUtil; public class ChatCopy { public function copyAllText(e:ChatCopyEvent):void { - var chat:ChatConversation = e.chatMessages; + var chatId: String = e.chatId; + var chat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(chatId); System.setClipboard(chat.getAllMessageAsString()); Alert.show(ResourceUtil.getInstance().getString('bbb.chat.copy.complete'), "", Alert.OK); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatMessageService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatMessageService.as index 7c441f7279..5ca247dcfc 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatMessageService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatMessageService.as @@ -28,6 +28,8 @@ package org.bigbluebutton.modules.chat.services import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.modules.chat.ChatConstants; import org.bigbluebutton.modules.chat.events.PublicChatMessageEvent; + import org.bigbluebutton.modules.chat.model.ChatConversation; + import org.bigbluebutton.modules.chat.model.ChatModel; import org.bigbluebutton.modules.chat.vo.ChatMessageVO; import org.bigbluebutton.util.i18n.ResourceUtil; @@ -104,10 +106,10 @@ package org.bigbluebutton.modules.chat.services welcomeMsg.toUserId = SPACE; welcomeMsg.toUsername = SPACE; welcomeMsg.message = welcome; + + var publicChat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(ChatModel.PUBLIC_CHAT_USERID); + publicChat.newChatMessage(welcomeMsg); - var welcomeMsgEvent:PublicChatMessageEvent = new PublicChatMessageEvent(PublicChatMessageEvent.PUBLIC_CHAT_MESSAGE_EVENT); - welcomeMsgEvent.message = welcomeMsg; - dispatcher.dispatchEvent(welcomeMsgEvent); //Say that client is ready when sending the welcome message ExternalInterface.call("clientReady", ResourceUtil.getInstance().getString('bbb.accessibility.clientReady')); @@ -124,10 +126,10 @@ package org.bigbluebutton.modules.chat.services moderatorOnlyMsg.toUserId = SPACE; moderatorOnlyMsg.toUsername = SPACE; moderatorOnlyMsg.message = LiveMeeting.inst().meeting.modOnlyMessage; + + var pChat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(ChatModel.PUBLIC_CHAT_USERID); + pChat.newChatMessage(moderatorOnlyMsg); - var moderatorOnlyMsgEvent:PublicChatMessageEvent = new PublicChatMessageEvent(PublicChatMessageEvent.PUBLIC_CHAT_MESSAGE_EVENT); - moderatorOnlyMsgEvent.message = moderatorOnlyMsg; - dispatcher.dispatchEvent(moderatorOnlyMsgEvent); } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatSaver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatSaver.as old mode 100644 new mode 100755 index 44a5c78e80..3a0f6a51ca --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatSaver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/ChatSaver.as @@ -1,20 +1,25 @@ package org.bigbluebutton.modules.chat.services { import flash.events.Event; - import mx.controls.Alert; import flash.net.FileReference; - import org.bigbluebutton.modules.chat.model.ChatConversation; + + import mx.controls.Alert; + + import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.modules.chat.events.ChatSaveEvent; - import org.bigbluebutton.util.i18n.ResourceUtil; + import org.bigbluebutton.modules.chat.model.ChatConversation; + import org.bigbluebutton.util.i18n.ResourceUtil; public class ChatSaver { public function ChatSaver(){} public function saveChatToFile(e:ChatSaveEvent):void{ - var chat:ChatConversation = e.chatMessages; + var chatId: String = e.chatId; var filename:String = e.filename; + var chat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(chatId); + var textToExport:String = chat.getAllMessageAsString(); var fileRef:FileReference = new FileReference(); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/MessageReceiver.as index ec676d5dc3..a2d692ea3d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/MessageReceiver.as @@ -27,10 +27,8 @@ package org.bigbluebutton.modules.chat.services import org.bigbluebutton.core.events.CoreEvent; import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.main.model.users.IMessageListener; - import org.bigbluebutton.modules.chat.events.ChatHistoryEvent; import org.bigbluebutton.modules.chat.events.ClearPublicChatEvent; import org.bigbluebutton.modules.chat.events.PrivateChatMessageEvent; - import org.bigbluebutton.modules.chat.events.PublicChatMessageEvent; import org.bigbluebutton.modules.chat.model.ChatConversation; import org.bigbluebutton.modules.chat.model.ChatModel; import org.bigbluebutton.modules.chat.vo.ChatMessageVO; @@ -79,22 +77,19 @@ package org.bigbluebutton.modules.chat.services var publicChat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(ChatModel.PUBLIC_CHAT_USERID); publicChat.processChatHistory(processedMessages); - var chEvent:ChatHistoryEvent = new ChatHistoryEvent(ChatHistoryEvent.RECEIVED_HISTORY); - chEvent.history = processedMessages; - dispatcher.dispatchEvent(chEvent); } private function handleSendPublicMessageEvtMsg(message:Object, history:Boolean = false):void { - LOGGER.debug("Handling public chat message [{0}]", [message.message]); - + LOGGER.debug("onMessageFromServer2x - " + JSON.stringify(message)); + var msg:ChatMessageVO = processIncomingChatMessage(message.body.message); var publicChat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(ChatModel.PUBLIC_CHAT_USERID); - publicChat.newChatMessage(msg); + LOGGER.debug("Handling public chat message [{0}]", [publicChat.getId()]); - var pcEvent:PublicChatMessageEvent = new PublicChatMessageEvent(PublicChatMessageEvent.PUBLIC_CHAT_MESSAGE_EVENT); - pcEvent.message = msg; - dispatcher.dispatchEvent(pcEvent); + publicChat.newChatMessage(msg); + LOGGER.debug("Num messages [{0}]", [publicChat.messages.length]); + var pcCoreEvent:CoreEvent = new CoreEvent(EventConstants.NEW_PUBLIC_CHAT); pcCoreEvent.message = message; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatBox.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatBox.mxml index ce990008f1..14a17b6026 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatBox.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatBox.mxml @@ -48,12 +48,10 @@ with BigBlueButton; if not, see . . private var lastTime:String = ""; [Bindable] - private var chatMessages:ChatConversation; + private var chatMessages: ArrayCollection = new ArrayCollection(); private var lastCount:Number = 0; private var scrollTimer:Timer; @@ -125,8 +123,7 @@ with BigBlueButton; if not, see . private var ctrlPressed:Boolean = false; private function onCreationComplete():void { - chatMessages = LiveMeeting.inst().chats.getChatConversation(id); - + chatOptions = Options.getOptions(ChatOptions) as ChatOptions; bindToHeightToDetermineHeightOfMessageList(); @@ -253,7 +250,10 @@ with BigBlueButton; if not, see . private function refreshChat(e:BBBEvent):void { if (e.payload.type == "BIGBLUEBUTTON_CONNECTION") { - if (publicChat) chatMessages = LiveMeeting.inst().chats.getChatConversation("PUBLIC_CHAT"); + if (publicChat) { + var myChat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(id); + chatMessages = myChat.messages; + } } } @@ -278,7 +278,8 @@ with BigBlueButton; if not, see . msg.toUsername = SPACE; msg.message = ""+ResourceUtil.getInstance().getString('bbb.chat.private.userLeft')+""; - chatMessages.newChatMessage(msg); + var myChat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(id); + myChat.newChatMessage(msg); } private function displayUserHasJoinedMessage():void { @@ -292,7 +293,8 @@ with BigBlueButton; if not, see . msg.toUsername = SPACE; msg.message = ""+ResourceUtil.getInstance().getString('bbb.chat.private.userJoined')+""; - chatMessages.newChatMessage(msg); + var myChat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(id); + myChat.newChatMessage(msg); } public function focusToTextMessageArea():void { @@ -302,14 +304,25 @@ with BigBlueButton; if not, see . private function handlePublicChatMessageEvent(event:PublicChatMessageEvent):void { if (publicChat) { + LOGGER.debug("GOT PUBLIC CHAT for id=" + id); // chatMessages.newChatMessage(event.message); + var chat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(id); + LOGGER.debug("FOUND PUBLIC CHAT for id=" + chat.getId()); + LOGGER.debug("NUM CHAT MESSAGES = " + chat.messages.length); + chatMessages = chat.messages; scrollToEndOfMessage(); } } private function handleRecievedChatHistoryEvent(event:ChatHistoryEvent):void { - if (publicChat && event.history != null) { + if (publicChat) { // chatMessages.processChatHistory(event.history); + LOGGER.debug("GOT PUBLIC CHAT HISTORY for id=" + id); + + var chat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(id); + LOGGER.debug("FOUND PUBLIC CHAT HISTORY for id=" + chat.getId()); + LOGGER.debug("NUM CHAT HISTORY MESSAGES = " + chat.messages.length); + chatMessages = chat.messages; scrollToEndOfMessage(); } } @@ -348,7 +361,8 @@ with BigBlueButton; if not, see . msg.toUsername = SPACE; msg.message = ""+ResourceUtil.getInstance().getString('bbb.chat.private.closeMessage', [keyCombo])+""; - chatMessages.newChatMessage(msg); + var myChat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(id); + myChat.newChatMessage(msg); } public function scrollToEndOfMessage():void { @@ -394,11 +408,12 @@ with BigBlueButton; if not, see . } private function copyAllText():void{ - System.setClipboard(chatMessages.getAllMessageAsString()); + var myChat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(id); + System.setClipboard(myChat.getAllMessageAsString()); } - public function getChatMessages():ChatConversation { - return chatMessages; + public function getChatId():String { + return id; } private function addContextMenuItems():void { @@ -414,7 +429,8 @@ with BigBlueButton; if not, see . private function menuItemHandler(e:ContextMenuEvent):void{ if (e.target.caption == ResourceUtil.getInstance().getString("bbb.chat.contextmenu.copyalltext")){ - System.setClipboard(chatMessages.getAllMessageAsString()); + var myChat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(id); + System.setClipboard(myChat.getAllMessageAsString()); } } @@ -598,7 +614,8 @@ with BigBlueButton; if not, see . private function handleClearPublicChatBoxMessages(event:ClearPublicChatEvent):void { if(publicChat){ - chatMessages.clearPublicChat(); + var myChat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(id); + myChat.clearPublicChat(); invalidateDisplayList(); validateNow(); } @@ -632,7 +649,7 @@ with BigBlueButton; if not, see . diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatView.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatView.mxml index d5f3f0f232..9f9ee755a5 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatView.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatView.mxml @@ -135,7 +135,7 @@ with BigBlueButton; if not, see . saveEvent.filename = chatBox.chatWithUsername; } - saveEvent.chatMessages = chatBox.getChatMessages(); + saveEvent.chatId = chatBox.id; globalDispatcher.dispatchEvent(saveEvent); } @@ -143,7 +143,7 @@ with BigBlueButton; if not, see . var chatBox:ChatBox = getPublicChatBox(); var copyEvent:ChatCopyEvent = new ChatCopyEvent(ChatCopyEvent.COPY_CHAT_EVENT); - copyEvent.chatMessages = chatBox.getChatMessages(); + copyEvent.chatId = chatBox.getChatId(); globalDispatcher.dispatchEvent(copyEvent); } @@ -172,7 +172,7 @@ with BigBlueButton; if not, see . private function handlePublicChatMessageEvent(event:PublicChatMessageEvent):void { notifyUserOfNewMessage(ChatModel.PUBLIC_CHAT_USERID); - if (!UsersUtil.isMe(event.message.fromUserId)) { + if (!UsersUtil.isMe(event.senderId)) { publicNotification(); } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/service/PollDataProcessor.as b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/service/PollDataProcessor.as index 9d9b24c560..6080eb6f98 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/service/PollDataProcessor.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/service/PollDataProcessor.as @@ -6,8 +6,11 @@ package org.bigbluebutton.modules.polling.service import org.as3commons.logging.api.ILogger; import org.as3commons.logging.api.getClassLogger; + import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.modules.chat.ChatConstants; import org.bigbluebutton.modules.chat.events.PublicChatMessageEvent; + import org.bigbluebutton.modules.chat.model.ChatConversation; + import org.bigbluebutton.modules.chat.model.ChatModel; import org.bigbluebutton.modules.chat.vo.ChatMessageVO; import org.bigbluebutton.modules.polling.events.PollShowResultEvent; import org.bigbluebutton.modules.polling.events.PollStartedEvent; @@ -93,9 +96,9 @@ package org.bigbluebutton.modules.polling.service pollResultMessage.toUsername = ResourceUtil.getInstance().getString("bbb.chat.chatMessage.systemMessage"); pollResultMessage.message = accessibleAnswers; - var pollResultMessageEvent:PublicChatMessageEvent = new PublicChatMessageEvent(PublicChatMessageEvent.PUBLIC_CHAT_MESSAGE_EVENT); - pollResultMessageEvent.message = pollResultMessage; - dispatcher.dispatchEvent(pollResultMessageEvent); + var pubChat: ChatConversation = LiveMeeting.inst().chats.getChatConversation(ChatModel.PUBLIC_CHAT_USERID); + pubChat.newChatMessage(pollResultMessage); + } }