define ( 'FRIENDICA_CODENAME', 'Lily of the valley');
define ( 'FRIENDICA_VERSION', '3.4.0' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
-define ( 'DB_UPDATE_VERSION', 1182 );
+define ( 'DB_UPDATE_VERSION', 1183 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
-- ------------------------------------------
--- Friendica 3.4.0 (Ginger)
--- DB_UPDATE_VERSION 1182
+-- Friendica 3.4.0 (Lily of the valley)
+-- DB_UPDATE_VERSION 1183
-- ------------------------------------------
`uri-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`avatar-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`term-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `last-item` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`priority` tinyint(3) NOT NULL DEFAULT 0,
`blocked` tinyint(1) NOT NULL DEFAULT 1,
`readonly` tinyint(1) NOT NULL DEFAULT 0,
"uri-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"avatar-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"term-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
+ "last-item" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"priority" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"),
"blocked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
"readonly" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
$current_post = $r[0]['id'];
logger('item_store: created item ' . $current_post);
- // 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.
+ // Set "success_update" and "last-item" to the date of the last time we heard from this contact
+ // This can be used to filter for inactive contacts.
// 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",
+
+ $update = (!$arr['private'] AND (($arr["author-link"] === $arr["owner-link"]) OR ($arr["parent-uri"] === $arr["uri"])));
+
+ // Is it a forum? Then we don't care about the rules from above
+ if (!$update AND ($arr["network"] == NETWORK_DFRN) AND ($arr["parent-uri"] === $arr["uri"])) {
+ $isforum = q("SELECT `forum` FROM `contact` WHERE `id` = %d AND `forum`",
+ intval($arr['contact-id']));
+ if ($isforum)
+ $update = true;
+ }
+
+ if ($update)
+ q("UPDATE `contact` SET `success_update` = '%s', `last-item` = '%s' WHERE `id` = %d",
+ dbesc($arr['received']),
dbesc($arr['received']),
intval($arr['contact-id'])
);
<?php
-define( 'UPDATE_VERSION' , 1182 );
+define( 'UPDATE_VERSION' , 1183 );
/**
*