mirror of
https://github.com/Mibew/mibew.git
synced 2024-11-15 08:34:11 +03:00
fix empty and double messages
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@97 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
91ab3aee5a
commit
bc06c38ade
@ -58,6 +58,7 @@ Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, {
|
||||
this._options.onComplete = this.requestComplete.bind(this);
|
||||
this.updater = {};
|
||||
this.frequency = (this._options.frequency || 2);
|
||||
this.cansend = true;
|
||||
FrameUtils.initFrame(this._options.container);
|
||||
if( this._options.message ) {
|
||||
this._options.message.onkeydown = this.handleKeyDown.bind(this);
|
||||
@ -96,6 +97,7 @@ Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, {
|
||||
|
||||
requestComplete: function(_response) {
|
||||
this.enableInput(true);
|
||||
this.cansend = true;
|
||||
var xmlRoot = Ajax.getXml(_response);
|
||||
if( xmlRoot && xmlRoot.tagName == 'thread' ) {
|
||||
this.updateContent( xmlRoot );
|
||||
@ -107,6 +109,10 @@ Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, {
|
||||
},
|
||||
|
||||
postMessage: function(msg) {
|
||||
if( msg == "" || !this.cansend) {
|
||||
return;
|
||||
}
|
||||
this.cansend = false;
|
||||
this.stopUpdate();
|
||||
this.updateOptions("post");
|
||||
var postOptions = {}.extend(this._options);
|
||||
|
Loading…
Reference in New Issue
Block a user