Fix for issues with the chat in 0.71
This commit is contained in:
parent
90a34ee8c9
commit
76366ca5f0
@ -34,7 +34,7 @@ package org.bigbluebutton.modules.chat.services
|
|||||||
var newMessage:String;
|
var newMessage:String;
|
||||||
/*newMessage = "<font color=\"#" + event.color + "\"><b>[" +
|
/*newMessage = "<font color=\"#" + event.color + "\"><b>[" +
|
||||||
attributes.username +" - "+ event.time + "]</b> " + event.message + "</font><br/>";*/
|
attributes.username +" - "+ event.time + "]</b> " + event.message + "</font><br/>";*/
|
||||||
newMessage = event.message + "|" + attributes.username + "|" + event.color + "|" + event.time + "|" + event.language;
|
newMessage = event.message + "|" + attributes.username + "|" + event.color + "|" + event.time + "|" + event.language + "|" + attributes.userid;
|
||||||
var messageVO:MessageVO = new MessageVO(newMessage, attributes.userid, event.toUser);
|
var messageVO:MessageVO = new MessageVO(newMessage, attributes.userid, event.toUser);
|
||||||
chatSOService.sendMessage(messageVO);
|
chatSOService.sendMessage(messageVO);
|
||||||
}
|
}
|
||||||
|
@ -156,9 +156,14 @@ package org.bigbluebutton.modules.chat.services
|
|||||||
private function receivedChatHistory(result:Object):void{
|
private function receivedChatHistory(result:Object):void{
|
||||||
if (result == null) return;
|
if (result == null) return;
|
||||||
|
|
||||||
var messages:Array = result as Array;
|
/*var messages:Array = result as Array;
|
||||||
for (var i:int=0; i<messages.length; i++){
|
for (var i:int=0; i<messages.length; i++){
|
||||||
newChatMessage(messages[i] as String);
|
newChatMessage(messages[i] as String);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
//Test
|
||||||
|
for (var i:int=0; i<testTranscript.length; i++){
|
||||||
|
newChatMessage(testTranscript[i] as String);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendTranscriptLoadedEvent();
|
sendTranscriptLoadedEvent();
|
||||||
@ -176,5 +181,34 @@ package org.bigbluebutton.modules.chat.services
|
|||||||
trace("Dispatching NET CONNECTION SUCCESS");
|
trace("Dispatching NET CONNECTION SUCCESS");
|
||||||
dispatcher.dispatchEvent(connEvent);
|
dispatcher.dispatchEvent(connEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var testTranscript:Array = new Array("zdravo|Denis|0|15:56|sr|513",
|
||||||
|
"kako ste|Joe|0|15:56|sr|514",
|
||||||
|
"ja ovde pokusavam da popravim razgovor|Joe|0|15:56|sr|514",
|
||||||
|
"ovo su neke poruke koje ja koristim za testiranje|Test User|0|15:56|sr|515",
|
||||||
|
"dobar dan|Denis|0|15:56|sr|513",
|
||||||
|
"jedan|Denis|0|15:56|sr|513",
|
||||||
|
"dva|Denis|0|15:56|sr|513",
|
||||||
|
"ten|Joe|0|15:56|en|514",
|
||||||
|
"twenty|Joe|0|15:56|en|514",
|
||||||
|
"thirty|Joe|0|15:56|en|514",
|
||||||
|
"forty|Joe|0|15:56|en|514",
|
||||||
|
"fifty|Joe|0|15:56|en|514",
|
||||||
|
"sixty|Joe|0|15:56|en|514",
|
||||||
|
"seventy|Joe|0|15:56|en|514",
|
||||||
|
"eighty|Joe|0|15:56|en|514",
|
||||||
|
"ninety|Joe|0|15:56|en|514",
|
||||||
|
"one hundred|Joe|0|15:56|en|514",
|
||||||
|
"one thousand|Joe|0|15:56|en|514",
|
||||||
|
"hello fuckers|Test User|0|15:56|en|515",
|
||||||
|
"hello fuckers|Test User|0|15:56|en|515",
|
||||||
|
"hello fuckers|Test User|0|15:56|en|515",
|
||||||
|
"hello fuckers|Test User|0|15:56|en|515",
|
||||||
|
"hello fuckers|Test User|0|15:56|en|515",
|
||||||
|
"hello fuckers|Test User|0|15:56|en|515",
|
||||||
|
"hello fuckers|Test User|0|15:56|en|515",
|
||||||
|
"hello fuckers|Test User|0|15:56|en|515",
|
||||||
|
"hello fuckers|Test User|0|15:56|en|515",
|
||||||
|
"hello fuckers|Test User|0|15:56|en|515");
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -30,12 +30,14 @@
|
|||||||
|
|
||||||
[Bindable] private var messages:ArrayCollection = new ArrayCollection();
|
[Bindable] private var messages:ArrayCollection = new ArrayCollection();
|
||||||
[Bindable] private var msg:Object;
|
[Bindable] private var msg:Object;
|
||||||
|
private var lastCount:Number = 0;
|
||||||
|
|
||||||
private function onCreationComplete():void{
|
private function onCreationComplete():void{
|
||||||
addContextMenuItems();
|
addContextMenuItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function updateScroll():void{
|
private function updateScroll(e:Event = null):void{
|
||||||
|
chatMessagesList.verticalScrollPosition = chatMessagesList.maxVerticalScrollPosition;
|
||||||
chatMessagesList.verticalScrollPosition = chatMessagesList.maxVerticalScrollPosition;
|
chatMessagesList.verticalScrollPosition = chatMessagesList.maxVerticalScrollPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,6 +70,15 @@
|
|||||||
|
|
||||||
chatMessagesList.invalidateSize();
|
chatMessagesList.invalidateSize();
|
||||||
chatMessagesList.invalidateDisplayList();
|
chatMessagesList.invalidateDisplayList();
|
||||||
|
|
||||||
|
|
||||||
|
var scrollTimer:Timer = new Timer(750, 1);
|
||||||
|
scrollTimer.addEventListener(TimerEvent.TIMER, onScrollTimer);
|
||||||
|
scrollTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onScrollTimer(e:TimerEvent):void{
|
||||||
|
updateScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getMinutes():String{
|
public static function getMinutes():String{
|
||||||
@ -134,6 +145,6 @@
|
|||||||
]]>
|
]]>
|
||||||
</mx:Script>
|
</mx:Script>
|
||||||
|
|
||||||
<mx:List width="100%" height="100%" id="chatMessagesList" updateComplete="updateScroll()" selectable="false" variableRowHeight="true"
|
<mx:List width="100%" height="100%" id="chatMessagesList" selectable="false" variableRowHeight="true"
|
||||||
itemRenderer="org.bigbluebutton.modules.chat.views.ChatMessageRenderer" dataProvider="{messages}" />
|
itemRenderer="org.bigbluebutton.modules.chat.views.ChatMessageRenderer" dataProvider="{messages}" />
|
||||||
</mx:VBox>
|
</mx:VBox>
|
||||||
|
@ -10,9 +10,11 @@
|
|||||||
import be.boulevart.google.events.GoogleApiEvent;
|
import be.boulevart.google.events.GoogleApiEvent;
|
||||||
|
|
||||||
import mx.binding.utils.ChangeWatcher;
|
import mx.binding.utils.ChangeWatcher;
|
||||||
|
import mx.controls.Alert;
|
||||||
|
|
||||||
[Bindable] private var rolledOver:Boolean = false;
|
[Bindable] private var rolledOver:Boolean = false;
|
||||||
private var dataWatcher:ChangeWatcher;
|
private var dataWatcher:ChangeWatcher;
|
||||||
|
private var g:GoogleTranslation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Chat Message Dynamic Object Anatomy:
|
* Chat Message Dynamic Object Anatomy:
|
||||||
@ -77,15 +79,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function translateMessage(text:String, fromLang:String, toLang:String):void{
|
private function translateMessage(text:String, fromLang:String, toLang:String):void{
|
||||||
var g:GoogleTranslation = new GoogleTranslation();
|
g = new GoogleTranslation();
|
||||||
g.addEventListener(GoogleApiEvent.TRANSLATION_RESULT, onTranslationDone);
|
g.addEventListener(GoogleApiEvent.TRANSLATION_RESULT, onTranslationDone);
|
||||||
g.translate(text, fromLang, toLang);
|
g.translate(text, fromLang, toLang);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function onTranslationDone(e:GoogleApiEvent):void{
|
private function onTranslationDone(e:GoogleApiEvent):void{
|
||||||
data.text = (e.data as GoogleTranslationResult).result;
|
var result:GoogleTranslationResult = e.data as GoogleTranslationResult;
|
||||||
|
if (result.orig != senderText) return;
|
||||||
|
|
||||||
|
data.text = result.result;
|
||||||
dataChangeHandler();
|
dataChangeHandler();
|
||||||
//chatMessagesList.invalidateList();
|
g.removeEventListener(GoogleApiEvent.TRANSLATION_RESULT, onTranslationDone);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function showDebug():void{
|
||||||
|
Alert.show("sender: " + senderText + ", translated: " + text);
|
||||||
}
|
}
|
||||||
|
|
||||||
]]>
|
]]>
|
||||||
|
Loading…
Reference in New Issue
Block a user