Added documentation, fixed some bug

This commit is contained in:
Michael Vogel 2016-02-04 10:19:13 +01:00
parent 2d0c2990ea
commit 5f6ba00408

View File

@ -776,7 +776,7 @@ class dfrn2 {
$item["parent-uri"] = $attributes->textContent; $item["parent-uri"] = $attributes->textContent;
// Get the type of the item (Top level post, reply or remote reply) // Get the type of the item (Top level post, reply or remote reply)
$entrytype = get_entry_type($importer, $item); $entrytype = self::get_entry_type($importer, $item);
// Now assign the rest of the values that depend on the type of the message // Now assign the rest of the values that depend on the type of the message
if ($entrytype == DFRN_REPLY_RC) { if ($entrytype == DFRN_REPLY_RC) {
@ -892,6 +892,8 @@ class dfrn2 {
if($posted_id) { if($posted_id) {
logger("Reply was stored with id ".$posted_id, LOGGER_DEBUG);
$item["id"] = $posted_id; $item["id"] = $posted_id;
$r = q("SELECT `parent`, `parent-uri` 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",
@ -918,6 +920,7 @@ class dfrn2 {
} }
if($posted_id AND $parent AND ($entrytype == DFRN_REPLY_RC)) { if($posted_id AND $parent AND ($entrytype == DFRN_REPLY_RC)) {
logger("Notifying followers about comment ".$posted_id, LOGGER_DEBUG);
proc_run("php", "include/notifier.php", "comment-import", $posted_id); proc_run("php", "include/notifier.php", "comment-import", $posted_id);
} }
@ -944,6 +947,8 @@ class dfrn2 {
$posted_id = item_store($item, false, $notify); $posted_id = item_store($item, false, $notify);
logger("Item was stored with id ".$posted_id, LOGGER_DEBUG);
if(stristr($item["verb"],ACTIVITY_POKE)) if(stristr($item["verb"],ACTIVITY_POKE))
self::do_poke($item, $importer, $posted_id); self::do_poke($item, $importer, $posted_id);
} }
@ -981,7 +986,7 @@ class dfrn2 {
$item = $r[0]; $item = $r[0];
$entrytype = get_entry_type($importer, $item); $entrytype = self::get_entry_type($importer, $item);
if(!$item["deleted"]) if(!$item["deleted"])
logger('deleting item '.$item["id"].' uri='.$uri, LOGGER_DEBUG); logger('deleting item '.$item["id"].' uri='.$uri, LOGGER_DEBUG);
@ -1074,11 +1079,13 @@ class dfrn2 {
} }
// if this is a relayed delete, propagate it to other recipients // if this is a relayed delete, propagate it to other recipients
if($entrytype == DFRN_REPLY_RC) if($entrytype == DFRN_REPLY_RC) {
logger("Notifying followers about deletion of post ".$item["id"], LOGGER_DEBUG);
proc_run("php", "include/notifier.php","drop", $item["id"]); proc_run("php", "include/notifier.php","drop", $item["id"]);
} }
} }
} }
}
/** /**
* @brief Imports a DFRN message * @brief Imports a DFRN message