mirror of
https://github.com/Mibew/i18n.git
synced 2025-02-02 09:34:41 +03:00
send new visitor notification
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@725 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
42bb76d504
commit
9a054da64b
@ -25,6 +25,7 @@ require_once('libs/operator.php');
|
||||
require_once('libs/groups.php');
|
||||
require_once('libs/expand.php');
|
||||
require_once('libs/captcha.php');
|
||||
require_once('libs/notify.php');
|
||||
|
||||
loadsettings();
|
||||
if($settings['enablessl'] == "1" && $settings['forcessl'] == "1") {
|
||||
@ -129,6 +130,7 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
|
||||
$postedid = post_message_($thread['threadid'],$kind_user,$firstmessage,$link,$visitor['name']);
|
||||
commit_thread( $thread['threadid'], array('shownmessageid' => $postedid), $link);
|
||||
}
|
||||
notify_operators($thread, $firstmessage, $link);
|
||||
mysql_close($link);
|
||||
}
|
||||
$threadid = $thread['threadid'];
|
||||
|
@ -643,6 +643,33 @@ function check_for_reassign($thread,$operator) {
|
||||
}
|
||||
}
|
||||
|
||||
function notify_operators($thread,$firstmessage,$link) {
|
||||
global $settings;
|
||||
if($settings['enablejabber'] == 1) {
|
||||
$groupid = $thread['groupid'];
|
||||
$query = "select chatoperator.operatorid as opid, inotify, vcjabbername, vcemail, (unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time from chatoperator";
|
||||
if($groupid) {
|
||||
$query .= ", chatgroupoperator where groupid = $groupid and chatoperator.operatorid = chatgroupoperator.operatorid and istatus = 0";
|
||||
} else {
|
||||
$query .= " where istatus = 0";
|
||||
}
|
||||
$query .= " and inotify = 1";
|
||||
$result = select_multi_assoc($query, $link);
|
||||
$text = getstring2_("notify.new.text", array(
|
||||
get_app_location(true, $settings['enablessl'] == '1' && $settings['forcessl'] == '1')."/operator/agent.php?thread=".$thread['threadid'],
|
||||
$thread['userName']
|
||||
), $thread['locale']);
|
||||
if($firstmessage) {
|
||||
$text .= "\n$firstmessage";
|
||||
}
|
||||
foreach($result as $op) {
|
||||
if($op['time'] < $settings['online_timeout'] && is_valid_email($op['vcjabbername'])) {
|
||||
webim_xmpp($op['vcjabbername'], getstring2("notify.new.subject", array($thread['userName'])), $text, $link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function check_connections_from_remote($remote,$link) {
|
||||
global $settings, $state_closed, $state_left;
|
||||
if($settings['max_connections_from_one_host'] == 0) {
|
||||
|
@ -49,4 +49,9 @@ function webim_mail($toaddr, $reply_to, $subject, $body, $link) {
|
||||
@mail($toaddr, $real_subject, wordwrap(myiconv($webim_encoding, $mail_encoding, $body),70), $headers);
|
||||
}
|
||||
|
||||
function webim_xmpp($toaddr, $subject, $text, $link) {
|
||||
global $current_locale;
|
||||
log_notification($current_locale, "xmpp", $toaddr, $subject, $text, null, $link);
|
||||
}
|
||||
|
||||
?>
|
@ -248,6 +248,8 @@ notifications.kind.xmpp=XMPP/Jabber
|
||||
notifications.kind=Kind of notification
|
||||
notifications.locale.all=-all-
|
||||
notifications.locale=Language
|
||||
notify.new.subject="{0}"
|
||||
notify.new.text={1}: {0}
|
||||
operator.group.no_description=<no description>
|
||||
operator.groups.intro=Choose groups according to operator skills.
|
||||
operator.groups.title=Operator groups
|
||||
|
Loading…
Reference in New Issue
Block a user