aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-01-16 21:52:16 +0100
committerMario Vavti <mario@mariovavti.com>2019-01-16 21:52:16 +0100
commitde8582ec07d125bf1c7f08cc3d695c33aaaf9d85 (patch)
treeb90f4aa1ba4869e3cf5e2cbdbd3e95aa68dcd2a7
parente6ccdc23781c7a70f17b97ab701d832d4719b624 (diff)
parenta1ac507a94b52c58c497f22be2b55d8d7b515cca (diff)
downloadvolse-hubzilla-de8582ec07d125bf1c7f08cc3d695c33aaaf9d85.tar.gz
volse-hubzilla-de8582ec07d125bf1c7f08cc3d695c33aaaf9d85.tar.bz2
volse-hubzilla-de8582ec07d125bf1c7f08cc3d695c33aaaf9d85.zip
Merge branch 'fix_dreport_issue' into dev
-rw-r--r--Zotlabs/Lib/DReport.php12
-rw-r--r--Zotlabs/Lib/Libzot.php9
2 files changed, 19 insertions, 2 deletions
diff --git a/Zotlabs/Lib/DReport.php b/Zotlabs/Lib/DReport.php
index 21b320cac..ef1ce2678 100644
--- a/Zotlabs/Lib/DReport.php
+++ b/Zotlabs/Lib/DReport.php
@@ -93,11 +93,19 @@ class DReport {
if(! $c)
return false;
+ // legacy zot recipients add a space and their name to the xchan. remove it if true.
- // is the recipient one of our connections, or do we want to store every report?
+ $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?
- $rxchan = $dr['recipient'];
$pcf = get_pconfig($c[0]['channel_id'],'system','dreport_store_all');
if($pcf)
return true;
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 87a5126f4..268622430 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -998,6 +998,15 @@ logger('4');
foreach($x['delivery_report'] as $xx) {
call_hooks('dreport_process',$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' ) ",
dbesc($xx['message_id']),
dbesc($xx['location']),