mirror of
https://github.com/friendica/friendica
synced 2024-12-23 00:00:21 +00:00
more preparation for activities
This commit is contained in:
parent
2e6041d1b6
commit
3a69413f86
5 changed files with 19 additions and 3 deletions
2
boot.php
2
boot.php
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
define ( 'BUILD_ID' , 1002 );
|
define ( 'BUILD_ID' , 1003 );
|
||||||
|
|
||||||
define ( 'EOL', "<br />\r\n");
|
define ( 'EOL', "<br />\r\n");
|
||||||
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
|
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
|
||||||
|
|
|
@ -146,6 +146,7 @@ CREATE TABLE IF NOT EXISTS `item` (
|
||||||
`contact-id` int(10) unsigned NOT NULL DEFAULT '0',
|
`contact-id` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
`type` char(255) NOT NULL,
|
`type` char(255) NOT NULL,
|
||||||
`wall` tinyint(1) NOT NULL DEFAULT '0',
|
`wall` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
`gravity` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
`parent` int(10) unsigned NOT NULL DEFAULT '0',
|
`parent` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
`parent-uri` char(255) CHARACTER SET ascii NOT NULL,
|
`parent-uri` char(255) CHARACTER SET ascii NOT NULL,
|
||||||
`created` datetime NOT NULL,
|
`created` datetime NOT NULL,
|
||||||
|
|
|
@ -306,6 +306,14 @@ function post_remote($a,$arr) {
|
||||||
|
|
||||||
//print_r($arr);
|
//print_r($arr);
|
||||||
|
|
||||||
|
|
||||||
|
if($arr['gravity'])
|
||||||
|
$arr['gravity = intval($arr['gravity']);
|
||||||
|
elseif($arr['parent-uri'] == $arr['uri'])
|
||||||
|
$arr['gravity'] = 0;
|
||||||
|
else($arr['verb'] == ACTIVITY_POST)
|
||||||
|
$arr['gravity'] = 6;
|
||||||
|
|
||||||
if(! x($arr,'type'))
|
if(! x($arr,'type'))
|
||||||
$arr['type'] = 'remote';
|
$arr['type'] = 'remote';
|
||||||
$arr['wall'] = ((intval($arr['wall'])) ? 1 : 0);
|
$arr['wall'] = ((intval($arr['wall'])) ? 1 : 0);
|
||||||
|
|
|
@ -112,18 +112,21 @@ function item_post(&$a) {
|
||||||
|
|
||||||
if(! strlen($verb))
|
if(! strlen($verb))
|
||||||
$verb = ACTIVITY_POST ;
|
$verb = ACTIVITY_POST ;
|
||||||
|
|
||||||
|
$gravity = (($parent) ? 6 : 0 );
|
||||||
|
|
||||||
$notify_type = (($parent) ? 'comment-new' : 'wall-new' );
|
$notify_type = (($parent) ? 'comment-new' : 'wall-new' );
|
||||||
|
|
||||||
$uri = item_new_uri($a->get_hostname(),$profile_uid);
|
$uri = item_new_uri($a->get_hostname(),$profile_uid);
|
||||||
|
|
||||||
$r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
|
$r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
|
||||||
`author-name`, `author-link`, `author-avatar`, `created`,
|
`author-name`, `author-link`, `author-avatar`, `created`,
|
||||||
`edited`, `changed`, `uri`, `title`, `body`, `location`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)
|
`edited`, `changed`, `uri`, `title`, `body`, `location`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)
|
||||||
VALUES( %d, '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )",
|
VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )",
|
||||||
intval($profile_uid),
|
intval($profile_uid),
|
||||||
dbesc($post_type),
|
dbesc($post_type),
|
||||||
intval($wall),
|
intval($wall),
|
||||||
|
intval($gravity),
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
dbesc($contact_record['name']),
|
dbesc($contact_record['name']),
|
||||||
dbesc($contact_record['url']),
|
dbesc($contact_record['url']),
|
||||||
|
|
|
@ -18,3 +18,7 @@ function update_1001() {
|
||||||
q("ALTER TABLE `item` ADD `wall` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `type` ");
|
q("ALTER TABLE `item` ADD `wall` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `type` ");
|
||||||
q("ALTER TABLE `item` ADD INDEX ( `wall` )");
|
q("ALTER TABLE `item` ADD INDEX ( `wall` )");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function update_1002() {
|
||||||
|
q("ALTER TABLE `item` ADD `gravity` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `wall` ");
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue