Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions

You are not logged in.

Announcement

#1 2015-06-11 14:46:39

Pavel
Member
From: Minsk, Belarus
Registered: 2014-08-22
Posts: 18
Website

again call of the 5 computer

02/06/2015 I post topic:
"Chrome Extension of the chat set to 5 computers of my managers. The Extension enabled. When a visitor comes to the site, and sends the message, the signal call on 5 computers. When 1 manager accepts the chat and tells the user, the call is continues sound on 4 computers.
How to make, when after accepts a chat of the first manager, the signal do not call other 4 computers?"

I tested again. situation has not changed. Please help fixed this bug.

Offline

#2 2015-06-11 15:35:44

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: again call of the 5 computer

I manager to reproduce, should be fixed in a few hours.

Offline

#3 2015-06-11 16:12:25

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: again call of the 5 computer

Here is your fix. Basically just tried to make algorithm a little bit smarter will see how it goes.
https://github.com/LiveHelperChat/liveh … 1f1b7ac706

Offline

#4 2015-06-12 07:44:27

Pavel
Member
From: Minsk, Belarus
Registered: 2014-08-22
Posts: 18
Website

Re: again call of the 5 computer

thanks for the help. I replaced the file lhc_web/design/defaulttheme/js/angular.lhc.js
and chat does not work. programm has failed. files are restored from a backup and chat working again.
1434092820_image_122.jpg
1434093016_image_123.png

old lhc_web/design/defaulttheme/js/angular.lhc.js

var phonecatApp = angular.module('lhcApp', [

  'lhcAppServices',

  'lhcAppControllers'

]);



var services = angular.module('lhcAppServices', []);

var lhcAppControllers = angular.module('lhcAppControllers', []);



angular.element(document).ready(function(){

    var element = angular.element(document.querySelector("form"));

    element.triggerHandler("$destroy");

    //

});





services.factory('LiveHelperChatFactory', ['$http','$q',function ($http, $q) {

	

	this.loadChatList = function(params){

		var deferred = $q.defer();		

		$http.get(WWW_DIR_JAVASCRIPT + 'chat/syncadmininterface').success(function(data) {

			 deferred.resolve(data);			 

		}).error(function(){

			deferred.reject('error');

		});		

		return deferred.promise;

	};

	

	this.truncate = function (text, length, end) {

        if (isNaN(length))

            length = 10;



        if (end === undefined)

            end = "...";



        if (text.length <= length || text.length - end.length <= length) {

            return text;

        }

        else {

            return String(text).substring(0, length-end.length) + end;

        }

    };   

	

	return this;

}]);





lhcAppControllers.controller('LiveHelperChatCtrl',['$scope','$http','$location','$rootScope', '$log','$interval','LiveHelperChatFactory', function($scope, $http, $location, $rootScope, $log, $interval,LiveHelperChatFactory) {



	$scope.predicate = 'last_visit';

	$scope.pending_chats = {};

	$scope.active_chats = {};

	$scope.closed_chats = {};

	$scope.unread_chats = {};

	$scope.transfer_dep_chats = {};

	$scope.transfer_chats = {};

	$scope.timeoutControl = null;

	

	$scope.loadChatList = function() {

		clearTimeout($scope.timeoutControl);

		LiveHelperChatFactory.loadChatList().then(function(data){	

						

				var hasPendingItems = false;

				

				angular.forEach(data.result, function(item, key){					

					$scope[key] = item;					

					if ( item.last_id_identifier ) {

	                    if (lhinst.trackLastIDS[item.last_id_identifier] == undefined ) {

	                    	lhinst.trackLastIDS[item.last_id_identifier] = parseInt(item.last_id);

	                    } else if (lhinst.trackLastIDS[item.last_id_identifier] < parseInt(item.last_id)) {

	                    	lhinst.trackLastIDS[item.last_id_identifier] = parseInt(item.last_id);

	                    	lhinst.playSoundNewAction(item.last_id_identifier,parseInt(item.last_id),(item.nick ? item.nick : 'Live Help'),(item.msg ? item.msg : confLH.transLation.new_chat));

	                    };

	                    if (parseInt(item.last_id) > 0) {

	                    	hasPendingItems = true;                        	

	                    };	                   

	                };

				});

				

				if (hasPendingItems == false) {

					lhinst.hideNotifications();

                };

                

                if ($scope.pending_chats.length == 0) {

                	clearTimeout(lhinst.soundIsPlaying);

				};

		

				setTimeout(function(){

					$(document).foundation('section', 'resize');

				},500);	

				

				$scope.timeoutControl = setTimeout(function(){

					$scope.loadChatList();

				},confLH.back_office_sinterval);

		},function(error){

				$scope.timeoutControl = setTimeout(function(){

					$scope.loadChatList();

				},confLH.back_office_sinterval);

		});

	};

	

	this.previewChat = function(chat_id){

		$.colorbox({'iframe':true,height:'500px',width:'500px', href:WWW_DIR_JAVASCRIPT+'chat/previewchat/'+chat_id});

	};		

	

	this.redirectContact = function(chat_id,message) {	

		return lhinst.redirectContact(chat_id,message);				

	};

	

	this.startChatNewWindow = function(chat_id,name) {

		return lhinst.startChatNewWindow(chat_id,name);	

	};

		

	this.startChat = function (chat_id,name) {		

		return lhinst.startChat(chat_id,$('#tabs'),LiveHelperChatFactory.truncate(name,10));				

	};

	

	this.startChatNewWindowTransfer = function(chat_id,name,transfer_id) {

		return lhinst.startChatNewWindowTransfer(chat_id,name,transfer_id);

	};

		

	this.startChatTransfer = function(chat_id,name,transfer_id) {

		return lhinst.startChatTransfer(chat_id,$('#tabs'),name,transfer_id);

	};

	

	this.startChatOperator = function(user_id) {	

		window.open(WWW_DIR_JAVASCRIPT + 'chat/startchatwithoperator/'+user_id,'operatorchatwindow-'+user_id,'menubar=1,resizable=1,width=780,height=450');

	};

	

	$scope.loadChatList();

}]);

Last edited by Pavel (2015-06-12 07:45:28)

Offline

#5 2015-06-12 07:53:57

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: again call of the 5 computer

From screenshot i see you have old version. You will have to update to the most recent version.

Offline

Board footer