mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 04:15:12 +00:00
filter posts you author from unseen notifications - note there are other ways to do this, but involve some code complexity. This is easier to implement but may have a slight impact on the ping query performance. It's not horrid, just mentioning for the record.
This commit is contained in:
parent
b7d2b9c1ef
commit
3065650683
3 changed files with 12 additions and 5 deletions
2
boot.php
2
boot.php
|
@ -241,6 +241,8 @@ define ( 'PHOTO_XCHAN', 0x0002 );
|
||||||
define ( 'PHOTO_THING', 0x0004 );
|
define ( 'PHOTO_THING', 0x0004 );
|
||||||
define ( 'PHOTO_ADULT', 0x0008 );
|
define ( 'PHOTO_ADULT', 0x0008 );
|
||||||
|
|
||||||
|
define ( 'PHOTO_FLAG_OS', 0x4000 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu types
|
* Menu types
|
||||||
*/
|
*/
|
||||||
|
|
13
mod/ping.php
13
mod/ping.php
|
@ -46,6 +46,7 @@ function ping_init(&$a) {
|
||||||
if(local_user()) {
|
if(local_user()) {
|
||||||
$vnotify = get_pconfig(local_user(),'system','vnotify');
|
$vnotify = get_pconfig(local_user(),'system','vnotify');
|
||||||
$evdays = intval(get_pconfig(local_user(),'system','evdays'));
|
$evdays = intval(get_pconfig(local_user(),'system','evdays'));
|
||||||
|
$ob_hash = get_observer_hash();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if unset show all visual notification types
|
// if unset show all visual notification types
|
||||||
|
@ -275,10 +276,12 @@ function ping_init(&$a) {
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
$r = q("SELECT * FROM item
|
$r = q("SELECT * FROM item
|
||||||
WHERE item_restrict = %d and ( item_flags & %d ) > 0 and uid = %d",
|
WHERE item_restrict = %d and ( item_flags & %d ) > 0 and uid = %d
|
||||||
|
and author_xchan != '%s' ",
|
||||||
intval(ITEM_VISIBLE),
|
intval(ITEM_VISIBLE),
|
||||||
intval(ITEM_UNSEEN),
|
intval(ITEM_UNSEEN),
|
||||||
intval(local_user())
|
intval(local_user()),
|
||||||
|
dbesc($ob_hash)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($r) {
|
if($r) {
|
||||||
|
@ -381,10 +384,12 @@ function ping_init(&$a) {
|
||||||
|
|
||||||
if($vnotify & (VNOTIFY_NETWORK|VNOTIFY_CHANNEL)) {
|
if($vnotify & (VNOTIFY_NETWORK|VNOTIFY_CHANNEL)) {
|
||||||
$r = q("SELECT id, item_restrict, item_flags FROM item
|
$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_flags & %d ) > 0 and uid = %d
|
||||||
|
and author_xchan != '%s'",
|
||||||
intval(ITEM_VISIBLE),
|
intval(ITEM_VISIBLE),
|
||||||
intval(ITEM_UNSEEN),
|
intval(ITEM_UNSEEN),
|
||||||
intval(local_user())
|
intval(local_user()),
|
||||||
|
dbesc($ob_hash)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($r) {
|
if($r) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2014-12-27.902
|
2014-12-28.903
|
||||||
|
|
Loading…
Reference in a new issue