debugging mark all seen for various notification types

This commit is contained in:
friendica 2013-02-04 00:03:19 -08:00
parent 13ff4b9f01
commit 421921d4d0
4 changed files with 17 additions and 11 deletions

View File

@ -588,15 +588,15 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url), 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url),
'profile_url' => $profile_link, 'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item), 'item_photo_menu' => item_photo_menu($item),
'name' => template_escape($profile_name), 'name' => $profile_name,
'sparkle' => $sparkle, 'sparkle' => $sparkle,
'lock' => $lock, 'lock' => $lock,
'thumb' => $profile_avatar, 'thumb' => $profile_avatar,
'title' => template_escape($item['title']), 'title' => $item['title'],
'body' => template_escape($body), 'body' => $body,
'tags' => template_escape($tags), 'tags' => $tags,
'hashtags' => template_escape($hashtags), 'hashtags' => $hashtags,
'mentions' => template_escape($mentions), 'mentions' => $mentions,
'txt_cats' => t('Categories:'), 'txt_cats' => t('Categories:'),
'txt_folders' => t('Filed under:'), 'txt_folders' => t('Filed under:'),
'has_cats' => ((count($categories)) ? 'true' : ''), 'has_cats' => ((count($categories)) ? 'true' : ''),
@ -604,14 +604,14 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
'categories' => $categories, 'categories' => $categories,
'folders' => $folders, 'folders' => $folders,
'text' => strip_tags(template_escape($body)), 'text' => strip_tags($body),
'ago' => relative_date($item['created']), 'ago' => relative_date($item['created']),
'app' => $item['app'], 'app' => $item['app'],
'str_app' => sprintf( t(' from %s'), $item['app']), 'str_app' => sprintf( t(' from %s'), $item['app']),
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'),
'location' => template_escape($location), 'location' => $location,
'indent' => '', 'indent' => '',
'owner_name' => template_escape($owner_name), 'owner_name' => $owner_name,
'owner_url' => $owner_url, 'owner_url' => $owner_url,
'owner_photo' => $owner_photo, 'owner_photo' => $owner_photo,
'plink' => get_plink($item), 'plink' => get_plink($item),
@ -705,6 +705,10 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
if($page_mode === 'preview') if($page_mode === 'preview')
logger('preview: ' . print_r($threads,true)); logger('preview: ' . print_r($threads,true));
// logger('nouveau: ' . print_r($threads,true));
$o = replace_macros($page_template, array( $o = replace_macros($page_template, array(
'$baseurl' => $a->get_baseurl($ssl_state), '$baseurl' => $a->get_baseurl($ssl_state),
'$live_update' => $live_update_div, '$live_update' => $live_update_div,

View File

@ -680,7 +680,7 @@ function network_content(&$a, $update = 0, $load = false) {
} }
// logger('items: ' . count($items)); logger('items: ' . count($items));
if($update_unseen) if($update_unseen)
$r = q("UPDATE `item` SET item_flags = ( item_flags ^ %d) $r = q("UPDATE `item` SET item_flags = ( item_flags ^ %d)

View File

@ -49,6 +49,7 @@ function ping_init(&$a) {
} }
if(x($_REQUEST,'markRead') && local_user()) { if(x($_REQUEST,'markRead') && local_user()) {
switch($_REQUEST['markRead']) { switch($_REQUEST['markRead']) {
case 'network': case 'network':
$r = q("update item set item_flags = ( item_flags ^ %d ) where (item_flags & %d) and uid = %d", $r = q("update item set item_flags = ( item_flags ^ %d ) where (item_flags & %d) and uid = %d",
@ -67,7 +68,7 @@ function ping_init(&$a) {
); );
break; break;
case 'messages': case 'messages':
$r = q("update mail set mail_flags = ( item_flags ^ %d ) where uid = %d and not (item_flags & %d)", $r = q("update mail set mail_flags = ( mail_flags ^ %d ) where channel_id = %d and not (mail_flags & %d)",
intval(MAIL_SEEN), intval(MAIL_SEEN),
intval(local_user()), intval(local_user()),
intval(MAIL_SEEN) intval(MAIL_SEEN)

View File

@ -33,6 +33,7 @@ function update_network_content(&$a) {
echo str_replace("\t",' ',$text); echo str_replace("\t",' ',$text);
echo (($_GET['msie'] == 1) ? '</div>' : '</section>'); echo (($_GET['msie'] == 1) ? '</div>' : '</section>');
echo "</body></html>\r\n"; echo "</body></html>\r\n";
// logger('update_network: ' . $text);
killme(); killme();
} }