Skip to content

Commit

Permalink
Show current page
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Sep 11, 2014
1 parent 2b1d18e commit 2f8ba69
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion lhc_web/modules/lhchat/chatwidgetchat.php
Expand Up @@ -48,7 +48,7 @@
$db->beginTransaction();

$chat->support_informed = 1;
$chat->user_typing = time()-5;// Show for shorter period these status messages
$chat->user_typing = time();// Show for shorter period these status messages
$chat->is_user_typing = 1;
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != ''){
$chat->user_typing_txt = $_SERVER['HTTP_REFERER'];
Expand Down
41 changes: 23 additions & 18 deletions lhc_web/modules/lhchat/chatwidgetclosed.php
Expand Up @@ -27,24 +27,29 @@
$chat = erLhcoreClassChat::getSession()->load( 'erLhcoreClassModelChat', $chatID);
if ($chat->hash == $hash && $chat->user_status != 1) {

$db = ezcDbInstance::get();
$db->beginTransaction();

// User closed chat
$chat->user_status = 1;
$chat->support_informed = 1;
$chat->user_typing = time()-5;// Show for shorter period these status messages
$chat->is_user_typing = 1;
$chat->user_typing_txt = htmlspecialchars_decode(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/userleftchat','User has left the chat!'),ENT_QUOTES);

if ( ($onlineuser = $chat->online_user) !== false) {
$onlineuser->reopen_chat = 0;
$onlineuser->saveThis();
}

erLhcoreClassChat::getSession()->update($chat);

$db->commit();

$db = ezcDbInstance::get();
$db->beginTransaction();

// User closed chat
$chat->user_status = 1;
$chat->support_informed = 1;

if ($chat->user_typing < (time()-12)) {
$chat->user_typing = time()-5;// Show for shorter period these status messages
$chat->is_user_typing = 1;
$chat->user_typing_txt = htmlspecialchars_decode(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/userleftchat','User has left the chat!'),ENT_QUOTES);
}

if ( ($onlineuser = $chat->online_user) !== false) {
$onlineuser->reopen_chat = 0;
$onlineuser->saveThis();
}

erLhcoreClassChat::getSession()->update($chat);

$db->commit();

}
} catch (Exception $e) {
// Do nothing
Expand Down

0 comments on commit 2f8ba69

Please sign in to comment.