require_once('include/email.php');
require_once('include/ostatus_conversation.php');
require_once('include/threads.php');
+require_once('include/socgraph.php');
function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) {
$current_post = $r[0]['id'];
logger('item_store: created item ' . $current_post);
+ // Add every contact to the global contact table
+ // Contacts from the statusnet connector are also added since you could add them in OStatus as well.
+ if (!$arr['private'] AND in_array($arr["network"],
+ array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, NETWORK_STATUSNET, "")))
+ poco_check($arr["author-link"], $arr["author-name"], $arr["author-avatar"], "", $arr["received"], $arr['contact-id'], $arr['uid']);
+
+ // Set "success_update" to the date of the last time we heard from this contact
+ // This can be used to filter for inactive contacts and poco.
+ // Only do this for public postings to avoid privacy problems, since poco data is public.
+ // Don't set this value if it isn't from the owner (could be an author that we don't know)
+ if (!$arr['private'] AND (($arr["author-link"] === $arr["owner-link"]) OR ($arr["parent-uri"] === $arr["uri"])))
+ q("UPDATE `contact` SET `success_update` = '%s' WHERE `id` = %d",
+ dbesc($arr['received']),
+ intval($arr['contact-id'])
+ );
+
// Only check for notifications on start posts
if ($arr['parent-uri'] === $arr['uri']) {
add_thread($r[0]['id']);
$datarray2 = $datarray;
logger('remote-self start - Contact '.$contact['url'].' - '.$contact['remote_self'].' Item '.print_r($datarray, true), LOGGER_DEBUG);
if ($contact['remote_self'] == 2) {
- $r = q("SELECT `id`,`url`,`name`,`photo`,`network` FROM `contact` WHERE `uid` = %d AND `self`",
+ $r = q("SELECT `id`,`url`,`name`,`thumb` FROM `contact` WHERE `uid` = %d AND `self`",
intval($contact['uid']));
if (count($r)) {
$datarray['contact-id'] = $r[0]["id"];
$datarray['owner-name'] = $r[0]["name"];
$datarray['owner-link'] = $r[0]["url"];
- $datarray['owner-avatar'] = $r[0]["avatar"];
+ $datarray['owner-avatar'] = $r[0]["thumb"];
$datarray['author-name'] = $datarray['owner-name'];
$datarray['author-link'] = $datarray['owner-link'];