aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ping.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-22 17:41:16 -0800
committerfriendica <info@friendica.com>2015-01-22 17:41:16 -0800
commite46eba125888704b4381aa8418495e91eeb565c8 (patch)
treed91e1e52560ea27be806f416485d32b831d03ebc /mod/ping.php
parent29436081a86650e7905a79eba4fdf7dc12f1c7c9 (diff)
downloadvolse-hubzilla-e46eba125888704b4381aa8418495e91eeb565c8.tar.gz
volse-hubzilla-e46eba125888704b4381aa8418495e91eeb565c8.tar.bz2
volse-hubzilla-e46eba125888704b4381aa8418495e91eeb565c8.zip
heavy lifting converting item flag bits
Diffstat (limited to 'mod/ping.php')
-rw-r--r--mod/ping.php22
1 files changed, 7 insertions, 15 deletions
diff --git a/mod/ping.php b/mod/ping.php
index e5fc4d930..62e8197df 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -151,17 +151,12 @@ function ping_init(&$a) {
if(x($_REQUEST, 'markRead') && local_user()) {
switch($_REQUEST['markRead']) {
case 'network':
- $r = q("update item set item_flags = ( item_flags & ~%d ) where (item_flags & %d) > 0 and uid = %d",
- intval(ITEM_UNSEEN),
- intval(ITEM_UNSEEN),
+ $r = q("update item set item_unseen = 0 where item_unseen = 1 and uid = %d",
intval(local_user())
);
break;
case 'home':
- $r = q("update item set item_flags = ( item_flags & ~%d ) where (item_flags & %d) > 0 and (item_flags & %d) > 0 and uid = %d",
- intval(ITEM_UNSEEN),
- intval(ITEM_UNSEEN),
- intval(ITEM_WALL),
+ $r = q("update item set item_unseen = 0 where item_unseen = 1 and item_wall = 1 and uid = %d",
intval(local_user())
);
break;
@@ -188,8 +183,7 @@ function ping_init(&$a) {
}
if(x($_REQUEST, 'markItemRead') && local_user()) {
- $r = q("update item set item_flags = ( item_flags & ~%d ) where parent = %d and uid = %d",
- intval(ITEM_UNSEEN),
+ $r = q("update item set item_unseen = 0 where parent = %d and uid = %d",
intval($_REQUEST['markItemRead']),
intval(local_user())
);
@@ -276,10 +270,9 @@ function ping_init(&$a) {
$result = array();
$r = q("SELECT * FROM item
- WHERE item_restrict = %d and ( item_flags & %d ) > 0 and uid = %d
+ WHERE item_restrict = %d and item_unseen = 1 and uid = %d
and author_xchan != '%s' ORDER BY created DESC",
intval(ITEM_VISIBLE),
- intval(ITEM_UNSEEN),
intval(local_user()),
dbesc($ob_hash)
);
@@ -287,7 +280,7 @@ function ping_init(&$a) {
if($r) {
xchan_query($r);
foreach($r as $item) {
- if((argv(1) === 'home') && (! ($item['item_flags'] & ITEM_WALL)))
+ if((argv(1) === 'home') && (! intval($item['item_wall'])))
continue;
$result[] = format_notification($item);
}
@@ -383,10 +376,9 @@ function ping_init(&$a) {
if($vnotify & (VNOTIFY_NETWORK|VNOTIFY_CHANNEL)) {
$r = q("SELECT id, item_restrict, item_flags FROM item
- WHERE (item_restrict = %d) and ( item_flags & %d ) > 0 and uid = %d
+ WHERE (item_restrict = %d) and item_unseen = 1 and uid = %d
and author_xchan != '%s'",
intval(ITEM_VISIBLE),
- intval(ITEM_UNSEEN),
intval(local_user()),
dbesc($ob_hash)
);
@@ -396,7 +388,7 @@ function ping_init(&$a) {
call_hooks('network_ping', $arr);
foreach ($r as $it) {
- if($it['item_flags'] & ITEM_WALL)
+ if(intval($it['item_wall']))
$result['home'] ++;
else
$result['network'] ++;