aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-21 16:06:25 -0800
committerfriendica <info@friendica.com>2015-01-21 16:06:25 -0800
commit29436081a86650e7905a79eba4fdf7dc12f1c7c9 (patch)
tree2f7e69d1cd55267bdc9eb604d1084e3d2f6ebc88 /mod
parent51848c619080e19cace647966a17eb9a1b42ca25 (diff)
downloadvolse-hubzilla-29436081a86650e7905a79eba4fdf7dc12f1c7c9.tar.gz
volse-hubzilla-29436081a86650e7905a79eba4fdf7dc12f1c7c9.tar.bz2
volse-hubzilla-29436081a86650e7905a79eba4fdf7dc12f1c7c9.zip
slow progress removing bitfields on item table
Diffstat (limited to 'mod')
-rw-r--r--mod/connedit.php4
-rw-r--r--mod/item.php22
-rwxr-xr-xmod/like.php11
-rwxr-xr-xmod/mood.php12
-rwxr-xr-xmod/poke.php10
-rwxr-xr-xmod/subthread.php29
-rw-r--r--mod/tagger.php6
-rw-r--r--mod/thing.php4
8 files changed, 52 insertions, 46 deletions
diff --git a/mod/connedit.php b/mod/connedit.php
index c27f4588a..f5dba8a02 100644
--- a/mod/connedit.php
+++ b/mod/connedit.php
@@ -186,7 +186,9 @@ function connedit_post(&$a) {
&& (intval(get_pconfig($channel['channel_id'],'system','post_newfriend')))) {
$xarr = array();
$xarr['verb'] = ACTIVITY_FRIEND;
- $xarr['item_flags'] = ITEM_WALL|ITEM_ORIGIN|ITEM_THREAD_TOP;
+ $xarr['item_wall'] = 1;
+ $xarr['item_origin'] = 1;
+ $xarr['item_thread_top'] = 1;
$xarr['owner_xchan'] = $xarr['author_xchan'] = $channel['channel_hash'];
$xarr['allow_cid'] = $channel['channel_allow_cid'];
$xarr['allow_gid'] = $channel['channel_allow_gid'];
diff --git a/mod/item.php b/mod/item.php
index b3370fecf..152c10b13 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -281,7 +281,7 @@ function item_post(&$a) {
// For comments, We need to additionally look at the parent and see if it's a wall post that originated locally.
if($observer['xchan_name'] != $owner_xchan['xchan_name']) {
- if($parent_item && ($parent_item['item_flags'] & (ITEM_WALL|ITEM_ORIGIN)) == (ITEM_WALL|ITEM_ORIGIN)) {
+ if(($parent_item) && ($parent_item['item_wall'] && $parent_item['item_origin'])) {
$walltowall_comment = true;
$walltowall = true;
}
@@ -640,14 +640,10 @@ function item_post(&$a) {
}
}
- if(local_user() != $profile_uid)
- $item_flags |= ITEM_UNSEEN;
-
- if($post_type === 'wall' || $post_type === 'wall-comment')
- $item_flags = $item_flags | ITEM_WALL;
+ $item_unseen = ((local_user() != $profile_uid) ? 1 : 0);
+ $item_wall = (($post_type === 'wall' || $post_type === 'wall-comment') ? 1 : 0);
+ $item_origin = (($origin) ? 1 : 0);
- if($origin)
- $item_flags = $item_flags | ITEM_ORIGIN;
if($moderated)
$item_restrict = $item_restrict | ITEM_MODERATED;
@@ -678,11 +674,9 @@ function item_post(&$a) {
$datarray = array();
- if(! $parent) {
- $item_flags = $item_flags | ITEM_THREAD_TOP;
- }
+ $item_thead_top = ((! $parent) ? 1 : 0);
- if ((! $plink) && ($item_flags & ITEM_THREAD_TOP)) {
+ if ((! $plink) && ($item_thread_top)) {
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid;
}
@@ -717,6 +711,10 @@ function item_post(&$a) {
$datarray['postopts'] = $postopts;
$datarray['item_restrict'] = $item_restrict;
$datarray['item_flags'] = $item_flags;
+ $datarray['item_unseen'] = $item_unseen;
+ $datarray['item_wall'] = $item_wall;
+ $datarray['item_origin'] = $item_origin;
+ $datarray['item_thread_top'] = $item_thread_top;
$datarray['layout_mid'] = $layout_mid;
$datarray['public_policy'] = $public_policy;
$datarray['comment_policy'] = map_scope($channel['channel_w_comment']);
diff --git a/mod/like.php b/mod/like.php
index b3afd910f..4d4d4249e 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -293,10 +293,12 @@ function like_content(&$a) {
}
$mid = item_message_id();
+ $arr = array();
if($extended_like) {
- $item_flags = ITEM_THREAD_TOP|ITEM_ORIGIN|ITEM_WALL;
-
+ $arr['item_thread_top'] = 1;
+ $arr['item_origin'] = 1;
+ $arr['item_wall'] = 1;
}
else {
$post_type = (($item['resource_type'] === 'photo') ? t('photo') : t('status'));
@@ -329,7 +331,9 @@ function like_content(&$a) {
if(! ($item['item_flags'] & ITEM_THREAD_TOP))
$post_type = 'comment';
- $item_flags = ITEM_ORIGIN | ITEM_NOTSHOWN;
+ $arr['item_origin'] = 1;
+ $arr['item_notshown'] = 1;
+
if($item['item_flags'] & ITEM_WALL)
$item_flags |= ITEM_WALL;
@@ -361,7 +365,6 @@ function like_content(&$a) {
killme();
- $arr = array();
if($extended_like) {
$ulink = '[zrl=' . $ch[0]['xchan_url'] . ']' . $ch[0]['xchan_name'] . '[/zrl]';
diff --git a/mod/mood.php b/mod/mood.php
index e6f4760e0..bf59eac1f 100755
--- a/mod/mood.php
+++ b/mod/mood.php
@@ -61,10 +61,6 @@ function mood_init(&$a) {
$mid = item_message_id();
$action = sprintf( t('%1$s is %2$s','mood'), '[zrl=' . $poster['xchan_url'] . ']' . $poster['xchan_name'] . '[/zrl]' , $verbs[$verb]);
- $item_flags = ITEM_WALL|ITEM_ORIGIN|ITEM_UNSEEN;
- if(! $parent_mid)
- $item_flags |= ITEM_THREAD_TOP;
-
$arr = array();
@@ -72,7 +68,6 @@ function mood_init(&$a) {
$arr['uid'] = $uid;
$arr['mid'] = $mid;
$arr['parent_mid'] = (($parent_mid) ? $parent_mid : $mid);
- $arr['item_flags'] = $item_flags;
$arr['author_xchan'] = $poster['xchan_hash'];
$arr['owner_xchan'] = (($parent_mid) ? $r[0]['owner_xchan'] : $poster['xchan_hash']);
$arr['title'] = '';
@@ -83,8 +78,13 @@ function mood_init(&$a) {
$arr['item_private'] = $private;
$arr['verb'] = $activity;
$arr['body'] = $action;
+ $arr['item_origin'] = 1;
+ $arr['item_wall'] = 1;
+ $arr['item_unseen'] = 1;
+ if(! $parent_mid)
+ $item['item_thread_top'] = 1;
- if ((! $arr['plink']) && ($arr['item_flags'] & ITEM_THREAD_TOP)) {
+ if ((! $arr['plink']) && intval($arr['item_thread_top'])) {
$arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $arr['mid'];
}
diff --git a/mod/poke.php b/mod/poke.php
index b22f7d9d5..9fde46f62 100755
--- a/mod/poke.php
+++ b/mod/poke.php
@@ -87,9 +87,6 @@ function poke_init(&$a) {
$arr = array();
- $arr['item_flags'] = ITEM_WALL | ITEM_ORIGIN;
- if($parent_item)
- $arr['item_flags'] |= ITEM_THREAD_TOP;
$arr['owner_xchan'] = (($parent_item) ? $parent_item['owner_xchan'] : $channel['channel_hash']);
$arr['parent_mid'] = (($parent_mid) ? $parent_mid : $mid);
@@ -115,6 +112,13 @@ function poke_init(&$a) {
$arr['object'] = json_encode($obj);
+ $arr['item_origin'] = 1;
+ $arr['item_wall'] = 1;
+ $arr['item_unseen'] = 1;
+ if(! $parent_item)
+ $item['item_thread_top'] = 1;
+
+
post_activity_item($arr);
return;
diff --git a/mod/subthread.php b/mod/subthread.php
index f0f54f4a6..92ada64ad 100755
--- a/mod/subthread.php
+++ b/mod/subthread.php
@@ -102,24 +102,23 @@ function subthread_content(&$a) {
$bodyverb = t('%1$s is following %2$s\'s %3$s');
- $item_flags = ITEM_ORIGIN | ITEM_NOTSHOWN;
- if($item['item_flags'] & ITEM_WALL)
- $item_flags |= ITEM_WALL;
-
-
$arr = array();
- $arr['mid'] = $mid;
- $arr['aid'] = $owner_aid;
- $arr['uid'] = $owner_uid;
- $arr['item_flags'] = $item_flags;
- $arr['parent'] = $item['id'];
- $arr['parent_mid'] = $item['mid'];
- $arr['thr_parent'] = $item['mid'];
- $arr['owner_xchan'] = $thread_owner['xchan_hash'];
- $arr['author_xchan'] = $observer['xchan_hash'];
+ $arr['mid'] = $mid;
+ $arr['aid'] = $owner_aid;
+ $arr['uid'] = $owner_uid;
+ $arr['parent'] = $item['id'];
+ $arr['parent_mid'] = $item['mid'];
+ $arr['thr_parent'] = $item['mid'];
+ $arr['owner_xchan'] = $thread_owner['xchan_hash'];
+ $arr['author_xchan'] = $observer['xchan_hash'];
+ $arr['item_origin'] = 1;
+ $arr['item_notshown'] = 1;
+ if(intval($item['item_wall']))
+ $arr['item_wall'] = 1;
+ else
+ $arr['item_wall'] = 0;
-
$ulink = '[zrl=' . $item_author['xchan_url'] . ']' . $item_author['xchan_name'] . '[/zrl]';
$alink = '[zrl=' . $observer['xchan_url'] . ']' . $observer['xchan_name'] . '[/zrl]';
$plink = '[zrl=' . $a->get_baseurl() . '/display/' . $item['mid'] . ']' . $post_type . '[/zrl]';
diff --git a/mod/tagger.php b/mod/tagger.php
index bfda114d2..83f6ee029 100644
--- a/mod/tagger.php
+++ b/mod/tagger.php
@@ -109,10 +109,8 @@ function tagger_content(&$a) {
$arr['owner_xchan'] = $item['owner_xchan'];
$arr['author_xchan'] = $channel['channel_hash'];
-
- $arr['item_flags'] = ITEM_ORIGIN;
- if($item['item_flags'] & ITEM_WALL)
- $arr['item_flags'] |= ITEM_WALL;
+ $arr['item_origin'] = 1;
+ $arr['item_wall'] = ((intval($item['item_wall'])) ? 1 : 0);
$ulink = '[zrl=' . $channel['xchan_url'] . ']' . $channel['channel_name'] . '[/zrl]';
$alink = '[zrl=' . $item['xchan_url'] . ']' . $item['xchan_name'] . '[/zrl]';
diff --git a/mod/thing.php b/mod/thing.php
index f53a6ab7b..4896c8a6e 100644
--- a/mod/thing.php
+++ b/mod/thing.php
@@ -182,8 +182,10 @@ function thing_init(&$a) {
$arr['owner_xchan'] = $channel['channel_hash'];
$arr['author_xchan'] = $channel['channel_hash'];
+ $arr['item_origin'] = 1;
+ $arr['item_wall'] = 1;
+ $arr['item_thread_top'] = 1;
- $arr['item_flags'] = ITEM_ORIGIN|ITEM_WALL|ITEM_THREAD_TOP;
$ulink = '[zrl=' . $channel['xchan_url'] . ']' . $channel['channel_name'] . '[/zrl]';
$plink = '[zrl=' . $term['url'] . ']' . $term['term'] . '[/zrl]';