2009-06-03 06:23:56 +08:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-06-26 23:32:49 +08:00
|
|
|
|
|
|
|
<!--
|
2013-01-22 05:14:55 +08:00
|
|
|
|
|
|
|
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/>.
|
|
|
|
|
2010-11-06 02:04:24 +08:00
|
|
|
-->
|
2009-06-26 23:32:49 +08:00
|
|
|
|
2009-06-03 06:23:56 +08:00
|
|
|
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml"
|
2009-07-28 22:45:47 +08:00
|
|
|
xmlns:maps="org.bigbluebutton.modules.chat.maps.*"
|
|
|
|
xmlns:mate="http://mate.asfusion.com/"
|
2009-06-03 06:23:56 +08:00
|
|
|
implements="org.bigbluebutton.common.IBigBlueButtonModule"
|
|
|
|
creationComplete="onCreationComplete()">
|
2009-07-28 22:45:47 +08:00
|
|
|
|
2010-07-31 02:29:01 +08:00
|
|
|
<maps:ChatEventMap id="chatLocalEventMap"/>
|
2009-07-29 23:11:59 +08:00
|
|
|
|
2009-06-03 06:23:56 +08:00
|
|
|
<mx:Script>
|
|
|
|
<![CDATA[
|
2015-07-20 23:51:04 +08:00
|
|
|
import com.asfusion.mate.events.Dispatcher;
|
|
|
|
|
|
|
|
import org.as3commons.logging.api.ILogger;
|
|
|
|
import org.as3commons.logging.api.getClassLogger;
|
|
|
|
import org.bigbluebutton.common.IBigBlueButtonModule;
|
|
|
|
import org.bigbluebutton.modules.chat.events.StartChatModuleEvent;
|
|
|
|
import org.bigbluebutton.modules.chat.events.StopChatModuleEvent;
|
2010-07-06 16:32:52 +08:00
|
|
|
|
2015-07-20 23:51:04 +08:00
|
|
|
private static const LOGGER:ILogger = getClassLogger(ChatModule);
|
|
|
|
|
|
|
|
|
2009-06-03 06:23:56 +08:00
|
|
|
private var _moduleName:String = "Chat Module";
|
|
|
|
private var _attributes:Object;
|
|
|
|
|
2010-07-31 02:29:01 +08:00
|
|
|
private var dispatcher:Dispatcher = new Dispatcher();
|
|
|
|
|
2009-06-03 06:23:56 +08:00
|
|
|
private function onCreationComplete():void {
|
2015-07-20 23:51:04 +08:00
|
|
|
LOGGER.debug("ChatModule Initialized");
|
2009-06-03 06:23:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2014-02-21 02:01:55 +08:00
|
|
|
|
2009-06-03 06:23:56 +08:00
|
|
|
public function get mode():String {
|
|
|
|
if (_attributes.mode == null) {
|
|
|
|
//_attributes.mode = "PLAYBACK"
|
|
|
|
_attributes.mode = "LIVE"
|
2015-07-20 23:51:04 +08:00
|
|
|
LOGGER.debug('Setting ChatModule mode: {0}', [_attributes.mode]);
|
2009-06-03 06:23:56 +08:00
|
|
|
}
|
2015-07-20 23:51:04 +08:00
|
|
|
LOGGER.debug('ChatModule mode: {0}', [_attributes.mode]);
|
2009-06-03 06:23:56 +08:00
|
|
|
return _attributes.mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get userid():Number {
|
|
|
|
return _attributes.userid as Number;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get role():String {
|
|
|
|
return _attributes.userrole as String;
|
|
|
|
}
|
|
|
|
|
2015-07-20 23:51:04 +08:00
|
|
|
public function start(attributes:Object):void {
|
|
|
|
LOGGER.debug("chat attr: ", [attributes.username]);
|
|
|
|
_attributes = attributes;
|
|
|
|
LOGGER.debug("Dispatching StartChatModuleEvent");
|
2009-07-28 22:45:47 +08:00
|
|
|
|
|
|
|
var event:StartChatModuleEvent = new StartChatModuleEvent(StartChatModuleEvent.START_CHAT_MODULE_EVENT)
|
|
|
|
event.start = true;
|
|
|
|
event.attributes = _attributes;
|
2010-07-31 02:29:01 +08:00
|
|
|
dispatcher.dispatchEvent(event);
|
2009-06-03 06:23:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public function stop():void {
|
2015-07-20 23:51:04 +08:00
|
|
|
LOGGER.debug("Dispatching StopChatModuleEvent");
|
2009-07-28 22:45:47 +08:00
|
|
|
var event:StopChatModuleEvent = new StopChatModuleEvent(StopChatModuleEvent.STOP_CHAT_MODULE_EVENT);
|
2010-07-31 02:29:01 +08:00
|
|
|
dispatcher.dispatchEvent(event);
|
2009-07-28 22:45:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private function handlePrivateChatMessageEvent(event:Event):void {
|
2015-07-20 23:51:04 +08:00
|
|
|
LOGGER.debug("Received PRIVATE CHAT MESSAGE EVENT");
|
2009-06-03 06:23:56 +08:00
|
|
|
}
|
2010-01-08 06:27:48 +08:00
|
|
|
|
2009-06-03 06:23:56 +08:00
|
|
|
]]>
|
|
|
|
</mx:Script>
|
|
|
|
</mx:Module>
|