aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-05 15:56:18 -0800
committerfriendica <info@friendica.com>2014-02-05 15:56:18 -0800
commitfdc0a7e95e1c0bd174bf09a4c3833ea29fd7211b (patch)
treeea5c4686f564b54c945815d0f7f51a3b1ff39150 /include/items.php
parent859531808918048d61ef9bf0c17a288fc4b96524 (diff)
downloadvolse-hubzilla-fdc0a7e95e1c0bd174bf09a4c3833ea29fd7211b.tar.gz
volse-hubzilla-fdc0a7e95e1c0bd174bf09a4c3833ea29fd7211b.tar.bz2
volse-hubzilla-fdc0a7e95e1c0bd174bf09a4c3833ea29fd7211b.zip
fix auto-add of bookmarks to find sender correctly and optionally auto add bookmarks for self
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php
index 35865086e..2f2bcb2e4 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2183,12 +2183,18 @@ function tag_deliver($uid,$item_id) {
if($terms && (! $i[0]['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'],$i[0]['author_xchan'],'bookmark') && (($i[0]['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,$i[0]['item_private']);
+ }
}
}
}