diff --git a/src/messenger/js/chat.js b/src/messenger/js/chat.js index 112480aa..ee8882b7 100644 --- a/src/messenger/js/chat.js +++ b/src/messenger/js/chat.js @@ -62,6 +62,7 @@ Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, { this.cansend = true; this.skipNextsound = true; this.focused = true; + this.ownThread = this._options.message != null; FrameUtils.initFrame(this._options.container); if( this._options.message ) { this._options.message.onkeydown = this.handleKeyDown.bind(this); @@ -205,6 +206,13 @@ Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, { this.showTyping(typing == '1'); } + var canpost = NodeUtils.getAttrValue(xmlRoot, "canpost"); + if( canpost ) { + if( canpost == '1' && !this.ownThread || this.ownThread && canpost != '1' ) { + window.location.href = window.location.href; + } + } + for( var i = 0; i < xmlRoot.childNodes.length; i++ ) { var node = xmlRoot.childNodes[i]; if( node.tagName == 'message' ) { diff --git a/src/messenger/webim/js/brws.js b/src/messenger/webim/js/brws.js index ad20dc02..20e92b21 100644 --- a/src/messenger/webim/js/brws.js +++ b/src/messenger/webim/js/brws.js @@ -1 +1 @@ -var myAgent="";var nk=0;var myRealAgent="";function qk(){var rk=["\157p\u0065\u0072\u0061","\u006d\u0073\u0069e","\163\141f\141ri","fi\u0072\u0065f\157\170","\156\145\164\u0073\u0063\141p\u0065","\u006d\157\172\u0069\u006c\154a"];var jj=navigator.userAgent.toLowerCase();for(var i=0;i<\150e\u0061\u0064\076");qt.write("");qt.write("<\057\150\145a\144>\u003c\u0062o\144y\040b\147c\u006fl\u006f\162='#\106F\u0046\106\106F'\040\u0074\145xt='\043\u0030\u0030\0600\060\u0030'\u0020l\u0069\156\u006b='\043\u0043\062\u0038\u0034\0600'\u0020v\154\151\u006e\u006b='#\u0043\u0032\u00384\u00300'\040\141l\151nk='#C28\06400'\040\155a\162gin\u0077\u0069dt\u0068\u003d'0'\u0020ma\162gi\156\150e\151\147\150t\u003d'0' \154ef\164m\141\162g\151n\075'\u0030' ri\u0067\u0068t\u006dargi\156='\u0030'\040t\u006f\160m\u0061rg\151\u006e='0'\u0020bo\164\164\157mmarg\u0069\156='\u0030'>");qt.write("\074ta\u0062\154e \u0077\151\144\u0074\u0068\075'1\u0030\u0030\u0025'\040\u0063\145\u006clspa\143\151ng\u003d'0'\040cel\u006cp\141dd\u0069ng\u003d'\u0030'\u0020\142\157r\u0064er='0'\076\074\164\u0072>\074td \166\u0061li\147n\075't\157p'\u0020\u0063l\141ss='\155\u0065s\u0073\141\u0067\u0065'\040\151d\075'cont\145nt'\076<\057\164\144\076<\u002ft\u0072\076=0){var su="\165p\144\141\164ed";if(this.et>0){var qh=((new Date()).getTime()-this.et)/0x3e8;su=su+"\u002c "+qh+"\u0020\u0073ec\u0073";if(qh>(9+1)){alert(su);} } this.et=(new Date()).getTime();this.zt(su);} else{this.rh();} if(zu){$s.ut(this.pq.bt);if(!this.gt){xs(rt.st+'/\163o\u0075\u006e\144\u0073/\156\145\167_m\145ss\u0061\147e.\u0077a\166');} if(!this.at){window.focus();} } } ,vt:function(k){if(k){sh=k.ctrlKey;k=k.which;} else{k=event.keyCode;sh=event.ctrlKey;} if(this.pq.ct&&((k==(9+4)&&(sh||myRealAgent=='\157\u0070e\u0072a'))||(k==012))){var th=this.pq.ct.value;if(myRealAgent=='op\145r\u0061'){th=th.replace(/[\r\n]+$/,'');} this.iu(th);return false;} return true;} ,hu:function(hq,tu,uh){if(tu&&tu.tagName=='\145\162ro\162'){this.zt(qs.rs(tu,"des\143\162"));} else{this.zt("\u0072e\143\u006f\u006en\u0065\143\u0074\151ng");} } ,hh:function(k){if($("e\156\147i\u006ee\151n\u0066o")){$("\145\156\147ine\u0069\156\u0066o").style.display='\u0069\156l\u0069ne';$("\145\u006e\u0067\151ne\u0069n\146\157").innerHTML=k;} } ,zt:function(k){if(this.ih)clearTimeout(this.ih);this.hh(k);this.ih=setTimeout(this.rh.on(this),07640);} ,rh:function(){$("\u0065\u006egin\u0065i\156\146\u006f").style.display='n\u006fn\145';} } );jh=mn.nn();jh.prototype={qn:function(pq){this.pq=pq;this.kh=0;if(this.pq.lh&&this.pq.oh&&this.pq.ph){this.pq.ph.onmousedown=this.dh.on(this);this.pq.ph.onmouseup=this.eh.on(this);this.pq.ph.onmousemove=this.fh.on(this);} } ,dh:function(e){var or=e||event;if(this.pq.ph.setCapture)this.pq.ph.setCapture();this.gh=this.pq.lh.style.pixelHeight||this.pq.lh.clientHeight;this.ah=or.screenY;this.pq.bh=this.pq.lh.style.pixelHeight+this.pq.oh.clientHeight-this.pq.ch;this.kh=1;} ,eh:function(){if(this.kh){if(this.pq.ph.releaseCapture)this.pq.ph.releaseCapture();this.kh=0;} } ,fh:function(e){var or=e||event;if(this.kh){var vh=this.gh-(or.screenY-this.ah);if(vh>this.pq.bh)vh=this.pq.bh;else if(vh<\150e\u0061\u0064\076");qt.write("");qt.write("<\057\150\145a\144>\u003c\u0062o\144y\040b\147c\u006fl\u006f\162='#\106F\u0046\106\106F'\040\u0074\145xt='\043\u0030\u0030\0600\060\u0030'\u0020l\u0069\156\u006b='\043\u0043\062\u0038\u0034\0600'\u0020v\154\151\u006e\u006b='#\u0043\u0032\u00384\u00300'\040\141l\151nk='#C28\06400'\040\155a\162gin\u0077\u0069dt\u0068\u003d'0'\u0020ma\162gi\156\150e\151\147\150t\u003d'0' \154ef\164m\141\162g\151n\075'\u0030' ri\u0067\u0068t\u006dargi\156='\u0030'\040t\u006f\160m\u0061rg\151\u006e='0'\u0020bo\164\164\157mmarg\u0069\156='\u0030'>");qt.write("\074ta\u0062\154e \u0077\151\144\u0074\u0068\075'1\u0030\u0030\u0025'\040\u0063\145\u006clspa\143\151ng\u003d'0'\040cel\u006cp\141dd\u0069ng\u003d'\u0030'\u0020\142\157r\u0064er='0'\076\074\164\u0072>\074td \166\u0061li\147n\075't\157p'\u0020\u0063l\141ss='\155\u0065s\u0073\141\u0067\u0065'\040\151d\075'cont\145nt'\076<\057\164\144\076<\u002ft\u0072\076=0){var tu="\165\u0070da\u0074ed";if(this.et>0){var sh=((new Date()).getTime()-this.et)/01750;tu=tu+",\u0020"+sh+"\u0020\u0073\145\u0063s";if(sh>012){alert(tu);} } this.et=(new Date()).getTime();this.$t(tu);} else{this.th();} if($u){$s.ut(this.pq.vt);if(!this.gt){xs(rt.st+'\057s\157un\u0064\163\057\u006ee\167_m\145\u0073s\u0061g\u0065.wa\u0076');} if(!this.at){window.focus();} } } ,wt:function(k){if(k){uh=k.ctrlKey;k=k.which;} else{k=event.keyCode;uh=event.ctrlKey;} if(this.pq.ct&&((k==(10+3)&&(uh||myRealAgent=='o\160er\141'))||(k==(6+4)))){var hh=this.pq.ct.value;if(myRealAgent=='op\145\162\u0061'){hh=hh.replace(/[\r\n]+$/,'');} this.ju(hh);return false;} return true;} ,iu:function(hq,uu,ih){if(uu&&uu.tagName=='e\162\u0072\u006fr'){this.$t(qs.rs(uu,"\u0064e\u0073\143r"));} else{this.$t("\162\145\143o\u006en\145c\u0074in\147");} } ,jh:function(k){if($("e\156gin\u0065\151\u006efo")){$("\u0065ng\u0069ne\u0069n\u0066\u006f").style.display='inl\u0069n\145';$("\u0065\u006e\u0067\151ne\u0069n\146\157").innerHTML=k;} } ,$t:function(k){if(this.kh)clearTimeout(this.kh);this.jh(k);this.kh=setTimeout(this.th.on(this),07640);} ,th:function(){$("\145\u006eg\151\u006e\u0065\u0069nfo").style.display='no\156\u0065';} } );lh=mn.nn();lh.prototype={qn:function(pq){this.pq=pq;this.oh=0;if(this.pq.ph&&this.pq.dh&&this.pq.eh){this.pq.eh.onmousedown=this.fh.on(this);this.pq.eh.onmouseup=this.gh.on(this);this.pq.eh.onmousemove=this.ah.on(this);} } ,fh:function(e){var or=e||event;if(this.pq.eh.setCapture)this.pq.eh.setCapture();this.bh=this.pq.ph.style.pixelHeight||this.pq.ph.clientHeight;this.ch=or.screenY;this.pq.vh=this.pq.ph.style.pixelHeight+this.pq.dh.clientHeight-this.pq.wh;this.oh=1;} ,gh:function(){if(this.oh){if(this.pq.eh.releaseCapture)this.pq.eh.releaseCapture();this.oh=0;} } ,ah:function(e){var or=e||event;if(this.oh){var xh=this.bh-(or.screenY-this.ch);if(xh>this.pq.vh)xh=this.pq.vh;else if(xh';} ,si:function(ds,ti){ds.deleteRow(ti+2);ds.deleteRow(ti+1);ds.deleteRow(ti);} ,ui:function(ds,ti){var hi=ds.insertRow(ti);var ws=hi.insertCell(-1);ws.colSpan=(8+5);ws.height=2;hi=ds.insertRow(ti);ws=hi.insertCell(-1);ws.colSpan=(9+4);ws.style.backgroundColor='\u0023\1051E1\1051';ws.innerHTML=''+ki+'<\u002f\141\076';} ,oi:function(content){return'\u003c\u0074able\u0020\u0077\u0069d\u0074\150\u003d"\061\u0030\u0030\045"\u0020c\u0065ll\u0073\160\141ci\u006eg="\060"\040c\145l\154pad\u0064i\u006e\u0067\075"\060"\040b\u006f\u0072\144\u0065r="\060"\076<\u0074r\u003e'+content+'\u003c/tr><\057t\u0061\142\u006c\u0065>';} ,pi:function(di,ei,id,fi,gi,ai,ct,bi){var ci=2;var link=ei+"\u003fth\u0072ead="+id;var vi='\u003c\151\155g\u0020\163r\u0063\075"'+st+'/\151ma\147es/f\162\u0065\145.gif" \167\151\u0064\164h\u003d"5" \150\145\u0069\u0067\150t="1" b\u006f\162d\145r\075"\060" a\u006c\u0074\u003d"">\u003c\057\164d>';if(gi){vi+='\u003c\164\144 \167idt\u0068="\u0033\060"\u0020alig\u006e\075"ce\u006e\164er"\u003e';vi+=qi.ii(link,localized[0],"\111m\u0043\145\156ter"+id,'';lj=qi.oi(lj);var oj=ls.os(nj,this.t);var pj=ls.os(nj+"\u0065\156d",this.t);if(hi!=null&&(hi.rowIndex<=oj.rowIndex||hi.rowIndex>=pj.rowIndex)){qi.si(this.t,hi.rowIndex+1);this.t.deleteRow(hi.rowIndex);this.yi[id]=null;hi=null;} if(hi==null){hi=this.t.insertRow(oj.rowIndex+1);qi.ui(this.t,oj.rowIndex+2);hi.id="t\150\u0072"+id;this.yi[id]=new Array(ij,kj,nj);ls.insertCell(hi,"\156\u0061\155\u0065","ta\u0062l\145",null,036,qi.pi(uj,this.pq.agentservl,id,fi,gi,ai,ct,nj!='c\u0068\141\164'));qi.ri(hi);ls.insertCell(hi,"\u0063\u006fn\u0074i\u0064","t\u0061b\u006c\u0065","c\u0065\u006et\u0065r",null,hj);qi.ri(hi);ls.insertCell(hi,"s\164at\145","\164\u0061ble","c\145\156t\145r",null,qj);qi.ri(hi);ls.insertCell(hi,"\157p","t\u0061bl\145","ce\156\u0074\145r",null,jj);qi.ri(hi);ls.insertCell(hi,"ti\u006d\u0065","\164a\u0062l\145","\u0063\145nt\u0065\162",null,this.dj(ij));qi.ri(hi);ls.insertCell(hi,"\u0077a\151\u0074","\u0074\u0061b\154\u0065","c\145\u006e\164\145r",null,(nj!='c\u0068\u0061\u0074'?this.dj(kj):'\u002d'));qi.ri(hi);ls.insertCell(hi,"\u0065tc","\u0074a\142\u006ce","\143en\u0074e\162",null,lj);if(nj=='\167\u0061\u0069t'||nj=='\u0070\u0072\u0069o')return true;} else{this.yi[id]=new Array(ij,kj,nj);sj(this.t,hi,"\156\141me",qi.pi(uj,this.pq.agentservl,id,fi,gi,ai,ct,nj!='ch\u0061t'));sj(this.t,hi,"\u0063\157\u006e\164\u0069\144",hj);sj(this.t,hi,"sta\u0074\u0065",qj);sj(this.t,hi,"\u006f\u0070",jj);sj(this.t,hi,"t\u0069\u006de",this.dj(ij));sj(this.t,hi,"\u0077\u0061\u0069\164",(nj!='c\150a\u0074'?this.dj(kj):'\u002d'));sj(this.t,hi,"\145tc",lj);} return false;} ,ej:function(){function fj(t,id,gj){var oj=t.rows[id];var pj=t.rows[id+"\u0065\156\u0064"];if(oj==null||pj==null)return;var aj=pj.cells["\u0073t\u0061\164u\u0073"];if(aj==null)return;aj.innerHTML=(oj.rowIndex+1==pj.rowIndex)?gj:"";aj.height=(oj.rowIndex+1==pj.rowIndex)?(25+5):(9+1);} fj(this.t,"w\u0061\u0069t",this.pq.noclients);fj(this.t,"p\u0072\151\157",this.pq.noclients);fj(this.t,"\143\150\u0061t",this.pq.noclients);} ,dj:function(bj){var cj=Math.floor(((new Date()).getTime()-bj-this.zi)/01750);var vj=Math.floor(cj/074);var wj="";cj=cj%074;if(cj<012)cj="0"+cj;if(vj>=074){var xj=Math.floor(vj/074);vj=vj%(50+10);if(vj<(8+2))vj="\060"+vj;wj=xj+":";} return wj+vj+":"+cj;} ,yj:function(){for(var i in this.yi){if(this.yi[i]!=null){var value=this.yi[i];var hi=ls.os("\u0074\150\162"+i,this.t);if(hi!=null){function sj(ds,hi,id,tj){var ws=ls.fs(id,hi,ds);if(ws)ws.innerHTML=tj;} sj(this.t,hi,"\164im\u0065",this.dj(value[0]));sj(this.t,hi,"\u0077a\151\u0074",(value[2]!='\u0063\u0068a\u0074'?this.dj(value[1]):'\055'));} } } } ,uu:function(zj){var $j=false;if(zj.tagName=='t\150\162\u0065\u0061\144s'){var _j=qs.ks(zj,"t\u0069m\u0065");var mk=qs.ks(zj,"\u0072e\u0076\u0069\163\u0069\u006f\u006e");if(_j)this.zi=(new Date()).getTime()-_j;if(mk)this.pq.xi=mk;for(var i=0;i';} ,di:function(content){return'\074\u0074ab\u006c\145 w\u0069dth\075"\06100%"\040ce\u006cl\u0073\u0070a\143\u0069ng\u003d"\u0030"\u0020\u0063e\154\u006c\u0070\141dd\u0069\156g\u003d"\060"\040bo\162d\145\162\u003d"\u0030"\076\074\164r\u003e'+content+'\074/\164\141\142le>';} ,ei:function(fi,gi,id,ai,bi,ci,ct,vi){var wi=2;var link=gi+"\077\164\150\162e\141\u0064\075"+id;var xi='\074t\u0064\u0020c\154a\163s\075"ta\u0062l\u0065"\040\u0073\164\u0079le\u003d"\160a\144\u0064\151ng-\u006ce\u0066t\u003a0p\170\073\040\u0070\141\144ding-\162i\147\150t\072\u0030\u0070x\u003b"\076';xi+=si.ki(vi?link:link+"\046\u0076\151ew\u006f\156\154y=\164ru\u0065",localized[bi?0:1],"I\155Ce\u006e\u0074er"+id,fi,01130,0644,ci);xi+='\074/\164d\076<\057\164d\u003e';if(bi){xi+='';xi+=si.ki(link,localized[0],"ImCe\156\u0074\145r"+id,'\074\151m\147\u0020sr\143\075"'+st+'\u002fi\u006dag\u0065\u0073\u002ft\142li\143\u006c\u0073\160\u0065ak\u002e\147i\146"\040\u0077i\u0064t\u0068\u003d"\061\065"\040\u0068\145\151\u0067\u0068\164\u003d"1\u0035" bo\u0072de\u0072="0"\040\141\154\164\u003d"'+localized[0]+'"\076',01130,0644,null);xi+='<\057\u0074d\076';wi++;} if(ai){xi+='';xi+=si.ki(link+"\046v\151\u0065wo\u006e\u006c\u0079=\u0074ru\u0065",localized[1],"\u0049\u006d\u0043\u0065n\164e\u0072"+id,'\074\u0069\u006d\u0067 \163\u0072\143="'+st+'\057\151m\141\147e\163\u002ft\u0062\154i\143lr\145a\144\056gif"\040\167\u0069d\u0074\150="\0615"\u0020\150e\u0069ght="\061\065" \u0062or\144\145\u0072\075"\u0030"\u0020\141\154t\075"'+localized[1]+'"\076',0x258,0644,null);xi+='\074/\164\144\076';wi++;} return si.di(xi);} } ;sq.yi=mn.nn();mn.sn(sq.yi,sq.lq,{qn:function(pq){this.oq(pq);this.pq.ri=this.ri.on(this);this.pq.iu=this.iu.on(this);this.pq.hu=this.hu.on(this);this.pq.zi=0;this.$i=new Object();this._i=0;this.t=this.pq.mj;this.nj=new sq.qi(this.pq);} ,ri:function(){return"co\155pan\u0079="+this.pq.company+"\u0026\u0073\u0069nc\145="+this.pq.zi;} ,$t:function(ku){this.pq.status.innerHTML=ku;} ,iu:function(s){this.$t(s);} ,qj:function(rh){var id,rj,sj,ai=false,bi=false,ci=null;for(var i=0;i=ej.rowIndex)){si.ui(this.t,ji.rowIndex+1);this.t.deleteRow(ji.rowIndex);this.$i[id]=null;ji=null;} if(ji==null){ji=this.t.insertRow(dj.rowIndex+1);si.ii(this.t,dj.rowIndex+2);ji.id="t\u0068\u0072"+id;this.$i[id]=new Array(kj,oj,rj);ls.insertCell(ji,"n\u0061\u006de","\164ab\154e",null,(20+10),si.ei(ij,this.pq.agentservl,id,ai,bi,ci,ct,rj!='c\u0068\u0061\164'));si.ti(ji);ls.insertCell(ji,"c\157\156\164i\144","t\141ble","\143e\156\164e\162",null,jj);si.ti(ji);ls.insertCell(ji,"\u0073tate","\u0074\u0061b\154e","\143\145\u006e\u0074er",null,sj);si.ti(ji);ls.insertCell(ji,"\u006f\160","\u0074a\142\u006c\u0065","\u0063e\156\u0074\145\162",null,lj);si.ti(ji);ls.insertCell(ji,"\u0074i\155e","t\u0061\u0062\u006ce","\143\u0065nt\145\162",null,this.fj(kj));si.ti(ji);ls.insertCell(ji,"w\u0061it","\164a\u0062l\145","\143\u0065\u006ete\u0072",null,(rj!='\u0063\150\141t'?this.fj(oj):'\055'));si.ti(ji);ls.insertCell(ji,"\145t\u0063","t\u0061\142\u006c\145","\u0063\145nte\u0072",null,pj);if(rj=='\u0077\u0061\u0069\164'||rj=='\u0070\162\151\u006f')return true;} else{this.$i[id]=new Array(kj,oj,rj);uj(this.t,ji,"\u006e\141me",si.ei(ij,this.pq.agentservl,id,ai,bi,ci,ct,rj!='\143\u0068a\u0074'));uj(this.t,ji,"\143ont\u0069\144",jj);uj(this.t,ji,"\u0073\u0074a\u0074\145",sj);uj(this.t,ji,"\u006fp",lj);uj(this.t,ji,"ti\155\u0065",this.fj(kj));uj(this.t,ji,"\167ai\u0074",(rj!='c\150a\164'?this.fj(oj):'-'));uj(this.t,ji,"\145\u0074\u0063",pj);} return false;} ,gj:function(){function aj(t,id,bj){var dj=t.rows[id];var ej=t.rows[id+"e\u006ed"];if(dj==null||ej==null)return;var cj=ej.cells["s\164\141\164u\u0073"];if(cj==null)return;cj.innerHTML=(dj.rowIndex+1==ej.rowIndex)?bj:"";cj.height=(dj.rowIndex+1==ej.rowIndex)?0x1e:(9+1);} aj(this.t,"\167ai\u0074",this.pq.noclients);aj(this.t,"\u0070\162\151\u006f",this.pq.noclients);aj(this.t,"\u0063\u0068\141\u0074",this.pq.noclients);} ,fj:function(vj){var wj=Math.floor(((new Date()).getTime()-vj-this._i)/0x3e8);var xj=Math.floor(wj/(46+14));var yj="";wj=wj%074;if(wj<(6+4))wj="0"+wj;if(xj>=074){var zj=Math.floor(xj/(55+5));xj=xj%074;if(xj<012)xj="\060"+xj;yj=zj+"\072";} return yj+xj+"\072"+wj;} ,$j:function(){for(var i in this.$i){if(this.$i[i]!=null){var value=this.$i[i];var ji=ls.os("\164\u0068r"+i,this.t);if(ji!=null){function uj(ds,ji,id,hj){var ws=ls.fs(id,ji,ds);if(ws)ws.innerHTML=hj;} uj(this.t,ji,"\164\u0069\u006d\145",this.fj(value[0]));uj(this.t,ji,"\u0077\u0061i\u0074",(value[2]!='\u0063\u0068\u0061\164'?this.fj(value[1]):'-'));} } } } ,hu:function(_j){var mk=false;if(_j.tagName=='t\u0068\u0072e\141d\u0073'){var nk=qs.ks(_j,"time");var qk=qs.ks(_j,"rev\u0069si\u006f\u006e");if(nk)this._i=(new Date()).getTime()-nk;if(qk)this.pq.zi=qk;for(var i=0;i<_j.childNodes.length;i++){var rh=_j.childNodes[i];if(rh.tagName=='\164hr\145ad')if(this.qj(rh))mk=true;} this.gj();this.$j();this.$t("\125\160 \164\157\040\144a\u0074\145");if(mk){xs(st+'\057\u0073o\u0075\u006e\144\163\u002f\156ew\137\u0075\u0073er.\u0077\141\166');window.focus();} } else if(_j.tagName=='e\u0072ro\162'){this.$t(qs.rs(_j,"de\163\u0063\u0072"));} else{this.$t("\u0072\145\u0063o\156n\145\143\164\u0069n\147");} } } );var st="";kr.lr(window,'on\u006c\u006f\u0061\144',function(){st=updaterOptions.wroot;new sq.yi(({mj:$("\u0074\u0068r\u0065a\144l\151st"),status:$("co\u006e\u006es\164\141\u0074u\163")} ).un(updaterOptions||{} ));} ); \ No newline at end of file diff --git a/src/messenger/webim/libs/chat.php b/src/messenger/webim/libs/chat.php index 7eb9d505..9969ee11 100644 --- a/src/messenger/webim/libs/chat.php +++ b/src/messenger/webim/libs/chat.php @@ -126,7 +126,7 @@ function get_messages($threadid,$meth,$isuser,&$lastid) { return $messages; } -function print_thread_messages($thread, $token, $lastid, $isuser,$format) { +function print_thread_messages($thread, $token, $lastid, $isuser, $format, $agentid=null) { global $webim_encoding, $webimroot, $connection_timeout; $threadid = $thread['threadid']; $istyping = abs($thread['current']-$thread[$isuser ? "lpagent" : "lpuser"]) < $connection_timeout @@ -136,7 +136,7 @@ function print_thread_messages($thread, $token, $lastid, $isuser,$format) { $output = get_messages($threadid,"xml",$isuser,$lastid); start_xml_output(); - print(""); + print(""); foreach( $output as $msg ) { print $msg; } diff --git a/src/messenger/webim/thread.php b/src/messenger/webim/thread.php index 182b84d6..6e1b6283 100644 --- a/src/messenger/webim/thread.php +++ b/src/messenger/webim/thread.php @@ -49,7 +49,7 @@ if( !$isuser && $act != "rename" ) { if( $act == "refresh" ) { $lastid = verifyparam( "lastid", "/^\d{1,9}$/", -1); - print_thread_messages($thread, $token, $lastid, $isuser,$outformat); + print_thread_messages($thread, $token, $lastid, $isuser,$outformat, $isuser ? null : $operator['operatorid']); exit; } else if( $act == "post" ) { @@ -64,7 +64,7 @@ if( $act == "refresh" ) { } post_message($threadid,$kind,$message,$from, $isuser ? null : $operator['operatorid'] ); - print_thread_messages($thread, $token, $lastid, $isuser, $outformat); + print_thread_messages($thread, $token, $lastid, $isuser, $outformat, $isuser ? null : $operator['operatorid']); exit; } else if( $act == "rename" ) {