- try to display welcome message
This commit is contained in:
parent
9aa4f274c3
commit
8673a31d75
@ -13,5 +13,9 @@ package org.bigbluebutton.core.managers
|
||||
public function getLogoutUrl():String {
|
||||
return conferenceParameters.logoutUrl;
|
||||
}
|
||||
|
||||
public function getWelcomeMessage():String {
|
||||
return conferenceParameters.welcome;
|
||||
}
|
||||
}
|
||||
}
|
@ -72,7 +72,12 @@
|
||||
<MethodInvoker generator="{ChatMessageService}" method="getPublicChatMessages"/>
|
||||
</EventHandlers>
|
||||
|
||||
<EventHandlers type="{TranscriptEvent.TRANSCRIPT_EVENT}" >
|
||||
<MethodInvoker generator="{ChatMessageService}" method="sendWelcomeMessage"/>
|
||||
</EventHandlers>
|
||||
|
||||
<Injectors target="{ChatMessageService}">
|
||||
<PropertyInjector targetKey="dispatcher" source="{scope.dispatcher}"/>
|
||||
<PropertyInjector targetKey="receiver" source="{MessageReceiver}"/>
|
||||
<PropertyInjector targetKey="sender" source="{MessageSender}"/>
|
||||
</Injectors>
|
||||
|
@ -1,11 +1,17 @@
|
||||
package org.bigbluebutton.modules.chat.services
|
||||
{
|
||||
import flash.events.IEventDispatcher;
|
||||
|
||||
import org.bigbluebutton.core.BBB;
|
||||
import org.bigbluebutton.modules.chat.ChatConstants;
|
||||
import org.bigbluebutton.modules.chat.events.PublicChatMessageEvent;
|
||||
import org.bigbluebutton.modules.chat.vo.ChatMessageVO;
|
||||
|
||||
public class ChatMessageService
|
||||
{
|
||||
public var sender:MessageSender;
|
||||
public var receiver:MessageReceiver;
|
||||
public var dispatcher:IEventDispatcher;
|
||||
|
||||
public function sendPublicMessage(message:ChatMessageVO):void
|
||||
{
|
||||
@ -21,5 +27,28 @@ package org.bigbluebutton.modules.chat.services
|
||||
{
|
||||
sender.getPublicChatMessages();
|
||||
}
|
||||
|
||||
private static const SPACE:String = " ";
|
||||
|
||||
public function sendWelcomeMessage():void {
|
||||
var welcome:String = BBB.initUserConfigManager().getWelcomeMessage();
|
||||
if (welcome != "") {
|
||||
var msg:ChatMessageVO = new ChatMessageVO();
|
||||
msg.chatType = ChatConstants.PUBLIC_CHAT;
|
||||
msg.fromUserID = SPACE;
|
||||
msg.fromUsername = SPACE;
|
||||
msg.fromColor = "0";
|
||||
msg.fromLang = "en";
|
||||
msg.fromTime = 0;
|
||||
msg.fromTimezoneOffset = 0;
|
||||
msg.toUserID = SPACE;
|
||||
msg.toUsername = SPACE;
|
||||
msg.message = welcome;
|
||||
|
||||
var pcEvent:PublicChatMessageEvent = new PublicChatMessageEvent(PublicChatMessageEvent.PUBLIC_CHAT_MESSAGE_EVENT);
|
||||
pcEvent.message = msg;
|
||||
dispatcher.dispatchEvent(pcEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -7,8 +7,10 @@ package org.bigbluebutton.modules.chat.services
|
||||
import org.bigbluebutton.core.EventConstants;
|
||||
import org.bigbluebutton.core.events.CoreEvent;
|
||||
import org.bigbluebutton.main.model.users.IMessageListener;
|
||||
import org.bigbluebutton.modules.chat.ChatConstants;
|
||||
import org.bigbluebutton.modules.chat.events.PrivateChatMessageEvent;
|
||||
import org.bigbluebutton.modules.chat.events.PublicChatMessageEvent;
|
||||
import org.bigbluebutton.modules.chat.events.TranscriptEvent;
|
||||
import org.bigbluebutton.modules.chat.vo.ChatMessageVO;
|
||||
|
||||
public class MessageReceiver implements IMessageListener
|
||||
@ -42,8 +44,11 @@ package org.bigbluebutton.modules.chat.services
|
||||
for (var i:int = 0; i < msgCount; i++) {
|
||||
handleChatReceivePublicMessageCommand(message.messages[i]);
|
||||
}
|
||||
|
||||
var pcEvent:TranscriptEvent = new TranscriptEvent(TranscriptEvent.TRANSCRIPT_EVENT);
|
||||
dispatcher.dispatchEvent(pcEvent);
|
||||
}
|
||||
|
||||
|
||||
private function handleChatReceivePublicMessageCommand(message:Object):void {
|
||||
LogUtil.debug("Handling public chat message [" + message.message + "]");
|
||||
var msg:ChatMessageVO = new ChatMessageVO();
|
||||
|
@ -323,13 +323,7 @@
|
||||
globalDispatcher.dispatchEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
private function handleTextAreaKeyUpEvent(e:KeyboardEvent):void {
|
||||
if (e.keyCode == Keyboard.ENTER) {
|
||||
sendMessages();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function advanceMessage(e:ShortcutEvent):void{
|
||||
if (e.otherUserID == chatWithUserID){
|
||||
if (currentMessage < (chatMessages.numMessages() - 3)){
|
||||
@ -478,9 +472,15 @@
|
||||
privateEvent.chatMessage = cm;
|
||||
globalDispatcher.dispatchEvent(privateEvent);
|
||||
}
|
||||
|
||||
private function handleTextAreaKeyUpEvent(e:KeyboardEvent):void {
|
||||
if (e.keyCode == Keyboard.ENTER) {
|
||||
sendMessages();
|
||||
}
|
||||
}
|
||||
|
||||
private function sendMessages():void {
|
||||
if (txtMsgArea.text != ""){
|
||||
if (txtMsgArea.text != "" || txtMsgArea.text == null){
|
||||
if (publicChat) {
|
||||
sendPublicChatMessage(txtMsgArea.text);
|
||||
} else{
|
||||
|
Loading…
Reference in New Issue
Block a user