aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorsasiflo <redmatrixdev@sasiflo.de>2014-04-06 12:21:24 +0200
committersasiflo <redmatrixdev@sasiflo.de>2014-04-06 12:21:24 +0200
commit6d170b2e07f9da8cb67cf0ac4e801b562735e8ae (patch)
treeab1d17d8cf72be4f258e0cb9999eaae2cd68dd6a /include
parentd084d5575cf4df347f2f393319cadb4b1f44f850 (diff)
parentad60e2c566930409d853517ca9392f169fc8e747 (diff)
downloadvolse-hubzilla-6d170b2e07f9da8cb67cf0ac4e801b562735e8ae.tar.gz
volse-hubzilla-6d170b2e07f9da8cb67cf0ac4e801b562735e8ae.tar.bz2
volse-hubzilla-6d170b2e07f9da8cb67cf0ac4e801b562735e8ae.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include')
-rw-r--r--include/enotify.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/include/enotify.php b/include/enotify.php
index 96a152d31..5be21f180 100644
--- a/include/enotify.php
+++ b/include/enotify.php
@@ -102,7 +102,7 @@ function notification($params) {
if(array_key_exists('item',$params) && (! visible_activity($params['item'])))
return;
- $parent_id = $params['parent'];
+ $parent_mid = $params['parent_mid'];
// Check to see if there was already a notify for this post.
// If so don't create a second notification
@@ -123,9 +123,9 @@ function notification($params) {
$p = null;
- if($params['otype'] === 'item' && $parent_id) {
- $p = q("select * from item where id = %d and uid = %d limit 1",
- intval($parent_id),
+ if($params['otype'] === 'item' && $parent_mid) {
+ $p = q("select * from item where mid = '%s' and uid = %d limit 1",
+ dbesc($parent_mid),
intval($recip['channel_id'])
);
}
@@ -135,6 +135,7 @@ function notification($params) {
$item_post_type = item_post_type($p[0]);
$private = $p[0]['item_private'];
+ $parent_id = $p[0]['id'];
//$possess_desc = str_replace('<!item_type!>',$possess_desc);
@@ -338,7 +339,7 @@ function notification($params) {
$datarray['aid'] = $recip['channel_account_id'];
$datarray['uid'] = $recip['channel_id'];
$datarray['link'] = $itemlink;
- $datarray['parent'] = $parent_id;
+ $datarray['parent'] = $parent_mid;
$datarray['type'] = $params['type'];
$datarray['verb'] = $params['verb'];
$datarray['otype'] = $params['otype'];
@@ -355,7 +356,7 @@ function notification($params) {
// create notification entry in DB
$r = q("insert into notify (hash,name,url,photo,date,aid,uid,link,parent,type,verb,otype)
- values('%s','%s','%s','%s','%s',%d,%d,'%s',%d,%d,'%s','%s')",
+ values('%s','%s','%s','%s','%s',%d,%d,'%s','%s',%d,'%s','%s')",
dbesc($datarray['hash']),
dbesc($datarray['name']),
dbesc($datarray['url']),
@@ -364,7 +365,7 @@ function notification($params) {
intval($datarray['aid']),
intval($datarray['uid']),
dbesc($datarray['link']),
- intval($datarray['parent']),
+ dbesc($datarray['parent']),
intval($datarray['type']),
dbesc($datarray['verb']),
dbesc($datarray['otype'])
@@ -432,7 +433,7 @@ function notification($params) {
$datarray['sitename'] = $sitename;
$datarray['siteurl'] = $siteurl;
$datarray['type'] = $params['type'];
- $datarray['parent'] = $params['parent'];
+ $datarray['parent'] = $params['parent_mid'];
$datarray['source_name'] = $sender['xchan_name'];
$datarray['source_link'] = $sender['xchan_url'];
$datarray['source_photo'] = $sender['xchan_photo_s'];