From e5e53660503b9f21403bdbc8f75efc22e642f533 Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Sat, 17 May 2008 22:14:29 +0000 Subject: [PATCH] fix: "Operator A is back" instead of "A changed A" git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@78 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/webim/libs/chat.php | 14 +++++++++++--- src/webim/locales/en/properties | 1 + src/webim/locales/ru/properties | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/webim/libs/chat.php b/src/webim/libs/chat.php index ac1b3330..797a2354 100644 --- a/src/webim/libs/chat.php +++ b/src/webim/libs/chat.php @@ -417,7 +417,11 @@ function take_thread($thread,$operator) { do_take_thread($threadid, $operator['operatorid'], $operatorName); if( $state == $state_waiting ) { - $message_to_post = getstring2_("chat.status.operator.changed", array($operatorName,$thread['agentName']), $thread['locale']); + if( $operatorName != $thread['agentName'] ) { + $message_to_post = getstring2_("chat.status.operator.changed", array($operatorName, $thread['agentName']), $thread['locale']); + } else { + $message_to_post = getstring2_("chat.status.operator.returned", array($operatorName), $thread['locale']); + } } else { $message_to_post = getstring2_("chat.status.operator.joined", array($operatorName), $thread['locale']); } @@ -441,8 +445,12 @@ function check_for_reassign($thread,$operator) { if( $thread['istate'] == $state_waiting && ( $thread['agentId'] == $operator['operatorid'] )) { do_take_thread($thread['threadid'], $operator['operatorid'], $operatorName); - $message_to_post = getstring2_("chat.status.operator.changed", array($operatorName,$thread['agentName']), $thread['locale']); - + if( $operatorName != $thread['agentName'] ) { + $message_to_post = getstring2_("chat.status.operator.changed", array($operatorName, $thread['agentName']), $thread['locale']); + } else { + $message_to_post = getstring2_("chat.status.operator.returned", array($operatorName), $thread['locale']); + } + post_message($thread['threadid'],$kind_events,$message_to_post); } } diff --git a/src/webim/locales/en/properties b/src/webim/locales/en/properties index b40ef373..98a777df 100644 --- a/src/webim/locales/en/properties +++ b/src/webim/locales/en/properties @@ -34,6 +34,7 @@ chat.status.operator.joined=Operator {0} joined the chat chat.status.user.changedname=Visitor changed the name {0} to {1} chat.status.user.reopenedthread=Visitor joined chat again chat.status.operator.changed=Operator {0} changed operator {1} +chat.status.operator.returned=Operator {0} is back chat.default.username=Visitor chat.error_page.title=Error chat.error_page.head=Error occurred: diff --git a/src/webim/locales/ru/properties b/src/webim/locales/ru/properties index d2fdab12..8e0b12f3 100644 --- a/src/webim/locales/ru/properties +++ b/src/webim/locales/ru/properties @@ -34,6 +34,7 @@ chat.status.operator.joined= chat.status.user.changedname=Посетитель сменил имя {0} на {1} chat.status.user.reopenedthread=Посетитель заново вошел в диалог chat.status.operator.changed=Оператор {0} сменил оператора {1} +chat.status.operator.returned=Оператор {0} вернулся в диалог chat.default.username=Посетитель chat.error_page.title=Ошибка chat.error_page.head=Произошла ошибка: