Skip to content

Commit

Permalink
Preparation for CloudTalk extension
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Jan 21, 2022
1 parent 282efbe commit 438035f
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lhc_web/design/defaulttheme/js/widgetv2/react.app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lhc_web/design/defaulttheme/js/widgetv2/react.app.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lhc_web/design/defaulttheme/tpl/pagelayouts/userchat2.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@
) : ?>
<?php if (!isset($Result['voice_call'])) : ?>
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/widgetv2/vendor.ie.js')?>?v=a2"></script>
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/widgetv2/.react.appie.js')?>?t=232"></script>
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/widgetv2/.react.appie.js')?>?t=233"></script>
<?php else : ?>
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/voice/voice.call.js')?>?t=3"></script>
<?php endif; ?>
<?php else : ?>
<?php if (!isset($Result['voice_call'])) : ?>
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/widgetv2/vendor.js')?>?v=a2"></script>
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/widgetv2/react.app.js')?>?t=232"></script>
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/widgetv2/react.app.js')?>?t=233"></script>
<?php else : ?>
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/voice/voice.call.js')?>?t=2"></script>
<?php endif; ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { endChat, initChatUI, pageUnload, storeSubscriber, initProactive, checkChatStatus, fetchMessages, addMessage, updateTriggerClicked } from "../actions/chatActions"
import { endChat, initChatUI, pageUnload, storeSubscriber, initProactive, checkChatStatus, fetchMessages, addMessage, updateTriggerClicked, updateMessage } from "../actions/chatActions"
import { helperFunctions } from "../lib/helperFunctions";
import i18n from "../i18n";

Expand Down Expand Up @@ -28,6 +28,7 @@ export default function (dispatch, getState) {
if (Array.isArray(args)) {
args.push(dispatch);
args.push(getState);
args.push(updateMessage);
}

if (typeof extensions[extension] !== 'undefined') {
Expand Down
10 changes: 10 additions & 0 deletions lhc_web/lib/core/lhchat/lhchatcommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,16 @@ public static function processCommand($params)

$trigger = $command->trigger;

$ignore = false;

if ($trigger instanceof erLhcoreClassModelGenericBotTrigger) {

$ignore = strpos($commandData['argument'],'--silent') !== false;

if ($ignore == true) {
$commandData['argument'] = trim(str_replace('--silent','',$commandData['argument']));
}

$argumentsTrigger = array(
'msg' => $commandData['argument'],
'caller_user_id' => $params['user']->id,
Expand All @@ -119,11 +127,13 @@ public static function processCommand($params)
erLhcoreClassGenericBotWorkflow::processTrigger($params['chat'], $trigger, false, array('args' => $argumentsTrigger));

$response = '"' . $trigger->name . '"' . ' ' . erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatcommand', 'was executed');

} else {
$response = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatcommand', 'Assigned trigger could not be found');
}

return array(
'ignore' => $ignore,
'processed' => true,
'process_status' => '',
'raw_message' => $commandData['command'] . ' || ' . $response
Expand Down
1 change: 1 addition & 0 deletions lhc_web/modules/lhgroupchat/loadgroupchat.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
if (erLhcoreClassModelGroupChatMember::getCount(array('filter' => array('group_id' => $groupChat->id, 'user_id' => $currentUser->getUserID()))) == 0){
throw new Exception('You are not a member of this private group!');
}

} else {
// Auto join if it's public chat
if (erLhcoreClassModelGroupChatMember::getCount(array('filter' => array('group_id' => $groupChat->id, 'user_id' => $currentUser->getUserID()))) == 0) {
Expand Down
2 changes: 1 addition & 1 deletion lhc_web/modules/lhwidgetrestapi/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@
$outputResponse['wv'] = 193;

// React APP versions
$outputResponse['v'] = 232;
$outputResponse['v'] = 233;

$outputResponse['hash'] = sha1(erLhcoreClassIPDetect::getIP() . $ts . erConfigClassLhConfig::getInstance()->getSetting( 'site', 'secrethash' ));
$outputResponse['hash_ts'] = $ts;
Expand Down

0 comments on commit 438035f

Please sign in to comment.