correct some activity object types (for comments), also fix a foreach warning resulting from recent tag work
This commit is contained in:
parent
d6ae124bbd
commit
168b67fa41
@ -419,6 +419,9 @@ function post_activity_item($arr) {
|
|||||||
|
|
||||||
$arr['verb'] = ((x($arr,'verb')) ? $arr['verb'] : ACTIVITY_POST);
|
$arr['verb'] = ((x($arr,'verb')) ? $arr['verb'] : ACTIVITY_POST);
|
||||||
$arr['obj_type'] = ((x($arr,'obj_type')) ? $arr['obj_type'] : ACTIVITY_OBJ_NOTE);
|
$arr['obj_type'] = ((x($arr,'obj_type')) ? $arr['obj_type'] : ACTIVITY_OBJ_NOTE);
|
||||||
|
if($is_comment)
|
||||||
|
$arr['obj_type'] = ACTIVITY_OBJ_COMMENT;
|
||||||
|
|
||||||
|
|
||||||
$arr['allow_cid'] = ((x($arr,'allow_cid')) ? $arr['allow_cid'] : $channel['channel_allow_cid']);
|
$arr['allow_cid'] = ((x($arr,'allow_cid')) ? $arr['allow_cid'] : $channel['channel_allow_cid']);
|
||||||
$arr['allow_gid'] = ((x($arr,'allow_gid')) ? $arr['allow_gid'] : $channel['channel_allow_gid']);
|
$arr['allow_gid'] = ((x($arr,'allow_gid')) ? $arr['allow_gid'] : $channel['channel_allow_gid']);
|
||||||
@ -2026,8 +2029,8 @@ function item_store($arr,$allow_exec = false) {
|
|||||||
$arr['coord'] = ((x($arr,'coord')) ? notags(trim($arr['coord'])) : '');
|
$arr['coord'] = ((x($arr,'coord')) ? notags(trim($arr['coord'])) : '');
|
||||||
$arr['parent_mid'] = ((x($arr,'parent_mid')) ? notags(trim($arr['parent_mid'])) : '');
|
$arr['parent_mid'] = ((x($arr,'parent_mid')) ? notags(trim($arr['parent_mid'])) : '');
|
||||||
$arr['thr_parent'] = ((x($arr,'thr_parent')) ? notags(trim($arr['thr_parent'])) : $arr['parent_mid']);
|
$arr['thr_parent'] = ((x($arr,'thr_parent')) ? notags(trim($arr['thr_parent'])) : $arr['parent_mid']);
|
||||||
$arr['verb'] = ((x($arr,'verb')) ? notags(trim($arr['verb'])) : '');
|
$arr['verb'] = ((x($arr,'verb')) ? notags(trim($arr['verb'])) : ACTIVITY_POST);
|
||||||
$arr['obj_type'] = ((x($arr,'obj_type')) ? notags(trim($arr['obj_type'])) : '');
|
$arr['obj_type'] = ((x($arr,'obj_type')) ? notags(trim($arr['obj_type'])) : ACTIVITY_OBJ_NOTE);
|
||||||
$arr['object'] = ((x($arr,'object')) ? trim($arr['object']) : '');
|
$arr['object'] = ((x($arr,'object')) ? trim($arr['object']) : '');
|
||||||
$arr['tgt_type'] = ((x($arr,'tgt_type')) ? notags(trim($arr['tgt_type'])) : '');
|
$arr['tgt_type'] = ((x($arr,'tgt_type')) ? notags(trim($arr['tgt_type'])) : '');
|
||||||
$arr['target'] = ((x($arr,'target')) ? trim($arr['target']) : '');
|
$arr['target'] = ((x($arr,'target')) ? trim($arr['target']) : '');
|
||||||
@ -2091,6 +2094,8 @@ function item_store($arr,$allow_exec = false) {
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($arr['obj_type'] == ACTIVITY_OBJ_NOTE)
|
||||||
|
$arr['obj_type'] = ACTIVITY_OBJ_COMMENT;
|
||||||
|
|
||||||
// is the new message multi-level threaded?
|
// is the new message multi-level threaded?
|
||||||
// even though we don't support it now, preserve the info
|
// even though we don't support it now, preserve the info
|
||||||
|
@ -133,6 +133,9 @@ function item_post(&$a) {
|
|||||||
if(! x($_REQUEST,'type'))
|
if(! x($_REQUEST,'type'))
|
||||||
$_REQUEST['type'] = 'net-comment';
|
$_REQUEST['type'] = 'net-comment';
|
||||||
|
|
||||||
|
if($obj_type == ACTIVITY_OBJ_POST)
|
||||||
|
$obj_type = ACTIVITY_OBJ_COMMENT;
|
||||||
|
|
||||||
if($parent) {
|
if($parent) {
|
||||||
$r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
|
$r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
|
||||||
intval($parent)
|
intval($parent)
|
||||||
@ -579,6 +582,8 @@ function item_post(&$a) {
|
|||||||
// Look for tags and linkify them
|
// Look for tags and linkify them
|
||||||
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);
|
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);
|
||||||
|
|
||||||
|
if($results) {
|
||||||
|
|
||||||
// Set permissions based on tag replacements
|
// Set permissions based on tag replacements
|
||||||
set_linkified_perms($results, $str_contact_allow, $str_group_allow, $profile_uid, $parent_item);
|
set_linkified_perms($results, $str_contact_allow, $str_group_allow, $profile_uid, $parent_item);
|
||||||
|
|
||||||
@ -595,6 +600,7 @@ function item_post(&$a) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$attachments = '';
|
$attachments = '';
|
||||||
$match = false;
|
$match = false;
|
||||||
@ -700,6 +706,7 @@ function item_post(&$a) {
|
|||||||
$datarray['location'] = $location;
|
$datarray['location'] = $location;
|
||||||
$datarray['coord'] = $coord;
|
$datarray['coord'] = $coord;
|
||||||
$datarray['verb'] = $verb;
|
$datarray['verb'] = $verb;
|
||||||
|
$datarray['obj_type'] = $obj_type;
|
||||||
$datarray['allow_cid'] = $str_contact_allow;
|
$datarray['allow_cid'] = $str_contact_allow;
|
||||||
$datarray['allow_gid'] = $str_group_allow;
|
$datarray['allow_gid'] = $str_group_allow;
|
||||||
$datarray['deny_cid'] = $str_contact_deny;
|
$datarray['deny_cid'] = $str_contact_deny;
|
||||||
|
Reference in New Issue
Block a user