diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-10-31 20:36:59 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-10-31 20:36:59 -0700 |
commit | b376f215337e4bee7320a0df8fc3d9b1beb2f289 (patch) | |
tree | 64db391a0605c512a8332eeba70e3b9b13934398 /mod | |
parent | b919a1e35ac404a929ec7f9ecec497abcda0279b (diff) | |
download | volse-hubzilla-b376f215337e4bee7320a0df8fc3d9b1beb2f289.tar.gz volse-hubzilla-b376f215337e4bee7320a0df8fc3d9b1beb2f289.tar.bz2 volse-hubzilla-b376f215337e4bee7320a0df8fc3d9b1beb2f289.zip |
notify folks who have been tagged in a post
Diffstat (limited to 'mod')
-rw-r--r-- | mod/follow.php | 2 | ||||
-rw-r--r-- | mod/item.php | 26 |
2 files changed, 17 insertions, 11 deletions
diff --git a/mod/follow.php b/mod/follow.php index 29c5f4230..235353f7a 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -163,7 +163,7 @@ function follow_post(&$a) { ); require_once('include/salmon.php'); - slapper($r[0],$contact,$slap); + slapper($r[0],$contact['notify'],$slap); goaway($_SESSION['return_url']); // NOTREACHED diff --git a/mod/item.php b/mod/item.php index af2c8d6f6..67832204d 100644 --- a/mod/item.php +++ b/mod/item.php @@ -14,8 +14,7 @@ function item_post(&$a) { require_once('include/security.php'); - $uid = $_SESSION['uid']; - + $uid = local_user(); $parent = ((x($_POST,'parent')) ? intval($_POST['parent']) : 0); @@ -115,7 +114,7 @@ function item_post(&$a) { } $str_tags = ''; - $tagged = array(); + $inform = ''; $tags = get_tags($body); @@ -125,14 +124,17 @@ function item_post(&$a) { if(strpos($tag,'@') === 0) { $name = substr($tag,1); if(strpos($name,'@')) { - + $newname = $name; $links = @webfinger($name); if(count($links)) { foreach($links as $link) { if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') $profile = $link['@attributes']['href']; - if($link['@attributes']['rel'] === 'salmon') - $salmon = $link['@attributes']['href']; + if($link['@attributes']['rel'] === 'salmon') { + if(strlen($inform)) + $inform .= ','; + $inform .= 'url:' . str_replace(',','%2c',$link['@attributes']['href']); + } } } } @@ -153,7 +155,9 @@ function item_post(&$a) { } if(count($r)) { $profile = $r[0]['url']; - $salmon = $r[0]['notify']; + if(strlen($inform)) + $inform .= ','; + $inform .= 'cid:' . $r[0]['id']; } } if($profile) { @@ -181,9 +185,9 @@ function item_post(&$a) { $uri = item_new_uri($a->get_hostname(),$profile_uid); $r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`, - `author-name`, `author-link`, `author-avatar`, `created`, - `edited`, `changed`, `uri`, `title`, `body`, `location`, `coord`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`) - VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )", + `author-name`, `author-link`, `author-avatar`, `created`, `edited`, `changed`, `uri`, `title`, `body`, `location`, `coord`, + `tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`) + VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )", intval($profile_uid), dbesc($post_type), intval($wall), @@ -203,6 +207,8 @@ function item_post(&$a) { dbesc($body), dbesc($location), dbesc($coord), + dbesc($str_tags), + dbesc($inform), dbesc($verb), dbesc($str_contact_allow), dbesc($str_group_allow), |