diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-07-30 06:09:20 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-07-30 06:09:20 -0700 |
commit | b399b20dee2752a038a64a8be2c89df142aae280 (patch) | |
tree | d94e361d0ec77efa3b0ceade9b762f6595bbc7eb /mod/dfrn_notify.php | |
parent | f83aa6c8a57e0ba9be2cd5842899488a4c2a8514 (diff) | |
download | volse-hubzilla-b399b20dee2752a038a64a8be2c89df142aae280.tar.gz volse-hubzilla-b399b20dee2752a038a64a8be2c89df142aae280.tar.bz2 volse-hubzilla-b399b20dee2752a038a64a8be2c89df142aae280.zip |
mail, i18n, etc.
Diffstat (limited to 'mod/dfrn_notify.php')
-rw-r--r-- | mod/dfrn_notify.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 4d7346000..fdf9a2108 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -46,6 +46,37 @@ dbg(3); $feed->enable_order_by_date(false); $feed->init(); + $ismail = false; + + $rawmail = $feed->get_feed_tags( NAMESPACE_DFRN, 'mail' ); + if(isset($rawmail[0]['child'][NAMESPACE_DFRN])) { + $ismail = true; + $base = $rawmail[0]['child'][NAMESPACE_DFRN]; + + $msg = array(); + $msg['uid'] = $importer['uid']; + $msg['from-name'] = notags(unxmlify($base['sender'][0]['child'][NAMESPACE_DFRN]['name'][0]['data'])); + $msg['from-photo'] = notags(unxmlify($base['sender'][0]['child'][NAMESPACE_DFRN]['avatar'][0]['data'])); + $msg['from-url'] = notags(unxmlify($base['sender'][0]['child'][NAMESPACE_DFRN]['avatar'][0]['data'])); + $msg['contact-id'] = $importer['id']; + $msg['title'] = notags(unxmlify($base['subject'][0]['data'])); + $msg['body'] = escape_tags(unxmlify($base['content'][0]['data'])); + $msg['delivered'] = 1; + $msg['seen'] = 0; + $msg['replied'] = 0; + $msg['uri'] = notags(unxmlify($base['id'][0]['data'])); + $msg['parent-uri'] = notags(unxmlify($base['in-reply-to'][0]['data'])); + $msg['created'] = datetime_convert(notags(unxmlify('UTC','UTC',$base['sentdate'][0]['data']))); + + $r = q("INSERT INTO `mail` (`" . implode("`, `", array_keys($msg)) + . "`) VALUES ('" . implode("', '", array_values($msg)) . "')" ); + + // send email notification if requested. + + xml_status(0); + return; + } + foreach($feed->get_items() as $item) { $deleted = false; |