diff options
author | friendica <info@friendica.com> | 2013-05-16 20:43:24 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-05-16 20:43:24 -0700 |
commit | 75461355ff25d4bfb15b7db18c00e906f4575fcf (patch) | |
tree | 0ffee7969aeaf6862cbe434041d9ebfff7ebaa17 | |
parent | c1c2ba7b4e3436bceed0e6b3253b848b77a924ec (diff) | |
download | volse-hubzilla-75461355ff25d4bfb15b7db18c00e906f4575fcf.tar.gz volse-hubzilla-75461355ff25d4bfb15b7db18c00e906f4575fcf.tar.bz2 volse-hubzilla-75461355ff25d4bfb15b7db18c00e906f4575fcf.zip |
extend delivery reports to mail
-rw-r--r-- | include/zot.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/zot.php b/include/zot.php index f36f15dc5..608c3877d 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1136,19 +1136,25 @@ function delete_imported_item($sender,$item,$uid) { } function process_mail_delivery($sender,$arr,$deliveries) { + + + $result = array(); foreach($deliveries as $d) { $r = q("select * from channel where channel_hash = '%s' limit 1", dbesc($d['hash']) ); - if(! $r) + if(! $r) { + $result[] = array($d['hash'],'not found'); continue; + } $channel = $r[0]; if(! perm_is_allowed($channel['channel_id'],$sender['hash'],'post_mail')) { logger("permission denied for mail delivery {$channel['channel_id']}"); + $result[] = array($d['hash'],'permission denied'); continue; } @@ -1162,9 +1168,11 @@ function process_mail_delivery($sender,$arr,$deliveries) { intval($r[0]['id']), intval($channel['channel_id']) ); + $result[] = array($d['hash'],'mail recalled'); logger('mail_recalled'); } else { + $result[] = array($d['hash'],'duplicate mail received'); logger('duplicate mail received'); } continue; @@ -1173,9 +1181,11 @@ function process_mail_delivery($sender,$arr,$deliveries) { $arr['account_id'] = $channel['channel_account_id']; $arr['channel_id'] = $channel['channel_id']; $item_id = mail_store($arr); + $result[] = array($d['hash'],'mail delivered'); } } + return $result; } function process_profile_delivery($sender,$arr,$deliveries) { |