Merge branch 'fix_dreport_issue' into dev
This commit is contained in:
commit
de8582ec07
@ -93,11 +93,19 @@ class DReport {
|
|||||||
if(! $c)
|
if(! $c)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// legacy zot recipients add a space and their name to the xchan. remove it if true.
|
||||||
|
|
||||||
|
$legacy_recipient = strpos($dr['recipient'], ' ');
|
||||||
|
if($legacy_recipient !== false) {
|
||||||
|
$legacy_recipient_parts = explode(' ', $dr['recipient'], 2);
|
||||||
|
$rxchan = $legacy_recipient_parts[0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$rxchan = $dr['recipient'];
|
||||||
|
}
|
||||||
|
|
||||||
// is the recipient one of our connections, or do we want to store every report?
|
// is the recipient one of our connections, or do we want to store every report?
|
||||||
|
|
||||||
|
|
||||||
$rxchan = $dr['recipient'];
|
|
||||||
$pcf = get_pconfig($c[0]['channel_id'],'system','dreport_store_all');
|
$pcf = get_pconfig($c[0]['channel_id'],'system','dreport_store_all');
|
||||||
if($pcf)
|
if($pcf)
|
||||||
return true;
|
return true;
|
||||||
|
@ -998,6 +998,15 @@ logger('4');
|
|||||||
foreach($x['delivery_report'] as $xx) {
|
foreach($x['delivery_report'] as $xx) {
|
||||||
call_hooks('dreport_process',$xx);
|
call_hooks('dreport_process',$xx);
|
||||||
if(is_array($xx) && array_key_exists('message_id',$xx) && DReport::is_storable($xx)) {
|
if(is_array($xx) && array_key_exists('message_id',$xx) && DReport::is_storable($xx)) {
|
||||||
|
|
||||||
|
// legacy recipients add a space and their name to the xchan. split those if true.
|
||||||
|
$legacy_recipient = strpos($xx['recipient'], ' ');
|
||||||
|
if($legacy_recipient !== false) {
|
||||||
|
$legacy_recipient_parts = explode(' ', $xx['recipient'], 2);
|
||||||
|
$xx['recipient'] = $legacy_recipient_parts[0];
|
||||||
|
$xx['name'] = $legacy_recipient_parts[1];
|
||||||
|
}
|
||||||
|
|
||||||
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s', '%s','%s','%s','%s','%s' ) ",
|
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s', '%s','%s','%s','%s','%s' ) ",
|
||||||
dbesc($xx['message_id']),
|
dbesc($xx['message_id']),
|
||||||
dbesc($xx['location']),
|
dbesc($xx['location']),
|
||||||
|
Reference in New Issue
Block a user