aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authormarijus <mario@localhost.localdomain>2014-02-06 14:56:59 +0100
committermarijus <mario@localhost.localdomain>2014-02-06 14:56:59 +0100
commita2b311991a90e1c78d30bad5504c18bb2a3c5c2a (patch)
tree54b5e5dbc7230442a3e1ec894c4a4c385b2d78c7 /include/items.php
parent419e3b5024efec40c98e48c3bf213c4e60d39fae (diff)
parent7a522be20bd66a0a904dcddf33d53e59aa04a92d (diff)
downloadvolse-hubzilla-a2b311991a90e1c78d30bad5504c18bb2a3c5c2a.tar.gz
volse-hubzilla-a2b311991a90e1c78d30bad5504c18bb2a3c5c2a.tar.bz2
volse-hubzilla-a2b311991a90e1c78d30bad5504c18bb2a3c5c2a.zip
Merge branch 'master' of https://github.com/friendica/red into upstream
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php27
1 files changed, 21 insertions, 6 deletions
diff --git a/include/items.php b/include/items.php
index 860d714d1..8b9cc8d04 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2107,6 +2107,15 @@ function send_status_notifications($post_id,$item) {
}
}
+ $link = get_app()->get_baseurl() . '/display/' . $item['mid'];
+
+ $r = q("select id from notify where link = '%s' and uid = %d limit 1",
+ dbesc($link),
+ intval($item['uid'])
+ );
+ if($r)
+ $notify = false;
+
if(! $notify)
return;
require_once('include/enotify.php');
@@ -2115,7 +2124,7 @@ function send_status_notifications($post_id,$item) {
'from_xchan' => $item['author_xchan'],
'to_xchan' => $r[0]['channel_hash'],
'item' => $item,
- 'link' => get_app()->get_baseurl() . '/display/' . $item['mid'],
+ 'link' => $link,
'verb' => ACTIVITY_POST,
'otype' => 'item',
'parent' => $parent,
@@ -2172,14 +2181,20 @@ function tag_deliver($uid,$item_id) {
$terms = get_terms_oftype($item['term'],TERM_BOOKMARK);
- if($terms && (! $i[0]['item_restrict'])) {
+ if($terms && (! $item['item_restrict'])) {
logger('tag_deliver: found bookmark');
- if(perm_is_allowed($u[0]['channel_id'],$i[0]['author_xchan'],'bookmark') && ($i[0]['author_xchan'] != $u[0]['channel_hash'])) {
+ $bookmark_self = intval(get_pconfig($uid,'system','bookmark_self'));
+ if(perm_is_allowed($u[0]['channel_id'],$item['author_xchan'],'bookmark') && (($item['author_xchan'] != $u[0]['channel_hash']) || ($bookmark_self))) {
require_once('include/bookmarks.php');
require_once('include/Contact.php');
- $s = channelx_by_hash($i[0]['author_xchan']);
- foreach($terms as $t) {
- bookmark_add($u[0],$s[0],$t,$i[0]['item_private']);
+
+ $s = q("select * from xchan where xchan_hash = '%s' limit 1",
+ dbesc($item['author_xchan'])
+ );
+ if($s) {
+ foreach($terms as $t) {
+ bookmark_add($u[0],$s[0],$t,$item['item_private']);
+ }
}
}
}