aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-14 18:36:23 -0800
committerfriendica <info@friendica.com>2015-01-14 18:36:23 -0800
commit168b67fa41b74a23a321e184cd8988644ec55dce (patch)
tree077859bacc2b8ed5e1ed1d1a82e3858850f4b798 /mod
parentd6ae124bbd549629ec7d76bb1b1555d1344ac8b4 (diff)
downloadvolse-hubzilla-168b67fa41b74a23a321e184cd8988644ec55dce.tar.gz
volse-hubzilla-168b67fa41b74a23a321e184cd8988644ec55dce.tar.bz2
volse-hubzilla-168b67fa41b74a23a321e184cd8988644ec55dce.zip
correct some activity object types (for comments), also fix a foreach warning resulting from recent tag work
Diffstat (limited to 'mod')
-rw-r--r--mod/item.php35
1 files changed, 21 insertions, 14 deletions
diff --git a/mod/item.php b/mod/item.php
index 7704d0ba6..b3370fecf 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -133,6 +133,9 @@ function item_post(&$a) {
if(! x($_REQUEST,'type'))
$_REQUEST['type'] = 'net-comment';
+ if($obj_type == ACTIVITY_OBJ_POST)
+ $obj_type = ACTIVITY_OBJ_COMMENT;
+
if($parent) {
$r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
intval($parent)
@@ -579,20 +582,23 @@ function item_post(&$a) {
// Look for tags and linkify them
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);
- // Set permissions based on tag replacements
- set_linkified_perms($results, $str_contact_allow, $str_group_allow, $profile_uid, $parent_item);
-
- $post_tags = array();
- foreach($results as $result) {
- $success = $result['success'];
- if($success['replaced']) {
- $post_tags[] = array(
- 'uid' => $profile_uid,
- 'type' => $success['termtype'],
- 'otype' => TERM_OBJ_POST,
- 'term' => $success['term'],
- 'url' => $success['url']
- );
+ if($results) {
+
+ // Set permissions based on tag replacements
+ set_linkified_perms($results, $str_contact_allow, $str_group_allow, $profile_uid, $parent_item);
+
+ $post_tags = array();
+ foreach($results as $result) {
+ $success = $result['success'];
+ if($success['replaced']) {
+ $post_tags[] = array(
+ 'uid' => $profile_uid,
+ 'type' => $success['termtype'],
+ 'otype' => TERM_OBJ_POST,
+ 'term' => $success['term'],
+ 'url' => $success['url']
+ );
+ }
}
}
@@ -700,6 +706,7 @@ function item_post(&$a) {
$datarray['location'] = $location;
$datarray['coord'] = $coord;
$datarray['verb'] = $verb;
+ $datarray['obj_type'] = $obj_type;
$datarray['allow_cid'] = $str_contact_allow;
$datarray['allow_gid'] = $str_group_allow;
$datarray['deny_cid'] = $str_contact_deny;