Browse Source

put a variant of the parent_uri into email notification message-ids. Current message-ids aren't completel legal. More work to do.

pull/440/head
friendica 9 years ago
parent
commit
68d7a3ae01
4 changed files with 12 additions and 6 deletions
  1. +1
    -1
      include/diaspora.php
  2. +4
    -2
      include/enotify.php
  3. +6
    -3
      include/items.php
  4. +1
    -0
      mod/item.php

+ 1
- 1
include/diaspora.php View File

@ -1350,7 +1350,7 @@ function diaspora_comment($importer,$xml,$msg) {
'verb' => ACTIVITY_POST,
'otype' => 'item',
'parent' => $conv_parent,
'parent_uri' => $parent_uri
));
// only send one notification


+ 4
- 2
include/enotify.php View File

@ -1,5 +1,7 @@
<?php
require_once('include/email.php');
function notification($params) {
logger('notification: entry', LOGGER_DEBUG);
@ -324,7 +326,7 @@ function notification($params) {
// If so, create the record of it and use a message-id smtp header.
if(!$r) {
logger("norify_id:" . intval($notify_id). ", parent: " . intval($params['parent']) . "uid: " .
logger("notify_id:" . intval($notify_id). ", parent: " . intval($params['parent']) . "uid: " .
intval($params['uid']), LOGGER_DEBUG);
$r = q("insert into `notify-threads` (`notify-id`, `master-parent-item`, `receiver-uid`, `parent-item`)
values(%d,%d,%d,%d)",
@ -495,7 +497,7 @@ class enotify {
$multipartMessageBody, // message body
$messageHeader // message headers
);
logger("notification: enotify::send header " . $header, LOGGER_DEBUG);
logger("notification: enotify::send header " . 'To: ' . $params['toEmail'] . "\n" . $messageHeader, LOGGER_DEBUG);
logger("notification: enotify::send returns " . $res, LOGGER_DEBUG);
}
}


+ 6
- 3
include/items.php View File

@ -2778,12 +2778,14 @@ function local_delivery($importer,$data) {
$parent = 0;
if($posted_id) {
$r = q("SELECT `parent` FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
$r = q("SELECT `parent`, `parent-uri` FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($posted_id),
intval($importer['importer_uid'])
);
if(count($r))
if(count($r)) {
$parent = $r[0]['parent'];
$parent_uri = $r[0]['parent-uri'];
}
if(! $is_like) {
$r1 = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `uid` = %d AND `parent` = %d",
@ -2823,7 +2825,7 @@ function local_delivery($importer,$data) {
'verb' => ACTIVITY_POST,
'otype' => 'item',
'parent' => $parent,
'parent_uri' => $parent_uri,
));
}
@ -2972,6 +2974,7 @@ function local_delivery($importer,$data) {
'verb' => ACTIVITY_POST,
'otype' => 'item',
'parent' => $conv_parent,
'parent_uri' => $parent_uri
));


+ 1
- 0
mod/item.php View File

@ -748,6 +748,7 @@ function item_post(&$a) {
'verb' => ACTIVITY_POST,
'otype' => 'item',
'parent' => $parent,
'parent_uri' => $parent_item['uri']
));
}


Loading…
Cancel
Save