bigbluebutton-Github/bigbluebutton-client/src/ChatModule.mxml

126 lines
4.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
This program is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 3.0 of the License, or (at your option) any later
version.
BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
-->
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:maps="org.bigbluebutton.modules.chat.maps.*"
xmlns:mate="http://mate.asfusion.com/"
implements="org.bigbluebutton.common.IBigBlueButtonModule"
creationComplete="onCreationComplete()">
<maps:ChatEventMap id="chatLocalEventMap"/>
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import mx.controls.Alert;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.modules.chat.ChatUtil;
import org.bigbluebutton.modules.chat.events.ChatEvent;
import org.bigbluebutton.modules.chat.events.PublicChatMessageEvent;
import org.bigbluebutton.modules.chat.events.StartChatModuleEvent;
import org.bigbluebutton.modules.chat.events.StopChatModuleEvent;
import org.bigbluebutton.modules.chat.events.TranscriptEvent;
import org.bigbluebutton.modules.chat.vo.ChatMessageVO;
import org.bigbluebutton.modules.chat.views.ChatBox;
private var _moduleName:String = "Chat Module";
private var _attributes:Object;
private var dispatcher:Dispatcher = new Dispatcher();
private function onCreationComplete():void {
LogUtil.debug("ChatModule Initialized");
}
public function get moduleName():String {
return _moduleName;
}
public function get uri():String {
if (_attributes.mode == "PLAYBACK") {
return _attributes.uri + "/" + _attributes.playbackRoom;
}
return _attributes.uri + "/" + _attributes.room;
}
public function get username():String {
return _attributes.username;
}
public function get mode():String {
if (_attributes.mode == null) {
//_attributes.mode = "PLAYBACK"
_attributes.mode = "LIVE"
LogUtil.debug('Setting ChatModule mode: ' + _attributes.mode);
}
LogUtil.debug('ChatModule mode: ' + _attributes.mode);
return _attributes.mode;
}
public function get userid():Number {
return _attributes.userid as Number;
}
public function get role():String {
return _attributes.userrole as String;
}
public function get traslationEnabled():Boolean{
if (_attributes.translationEnabled == "false") return false;
else return true;
}
public function get translationOn():Boolean{
if (_attributes.translationOn == "false") return false;
else return true;
}
public function start(attributes:Object):void {
LogUtil.debug("chat attr: " + attributes.username);
_attributes = attributes;
LogUtil.debug("Dispatching StartChatModuleEvent");
var event:StartChatModuleEvent = new StartChatModuleEvent(StartChatModuleEvent.START_CHAT_MODULE_EVENT)
event.start = true;
event.attributes = _attributes;
event.translationOn = translationOn;
event.translationEnabled = traslationEnabled;
dispatcher.dispatchEvent(event);
}
public function stop():void {
LogUtil.debug("Dispatching StopChatModuleEvent");
var event:StopChatModuleEvent = new StopChatModuleEvent(StopChatModuleEvent.STOP_CHAT_MODULE_EVENT);
dispatcher.dispatchEvent(event);
}
private function handlePrivateChatMessageEvent(event:Event):void {
trace("Received PRIVATE CHAT MESSAGE EVENT");
}
]]>
</mx:Script>
</mx:Module>