aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-07-19 21:09:40 -0700
committerfriendica <info@friendica.com>2012-07-19 21:09:40 -0700
commitbf386749047731d3a7f47fd99f7dcc4e93ed7be7 (patch)
tree49168f1e7d3ca11f0b3622ca9129904af15608bf /include/items.php
parent6293c5e1cf53eeb6db487c74c6e4cec8a11148d4 (diff)
downloadvolse-hubzilla-bf386749047731d3a7f47fd99f7dcc4e93ed7be7.tar.gz
volse-hubzilla-bf386749047731d3a7f47fd99f7dcc4e93ed7be7.tar.bz2
volse-hubzilla-bf386749047731d3a7f47fd99f7dcc4e93ed7be7.zip
sync
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php52
1 files changed, 51 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php
index 21b7d9433..b11250f8b 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2818,7 +2818,57 @@ function local_delivery($importer,$data) {
$datarray['owner-avatar'] = $importer['thumb'];
}
- $r = item_store($datarray);
+ $posted_id = item_store($datarray);
+
+ if(stristr($datarray['verb'],ACTIVITY_POKE)) {
+ $verb = urldecode(substr($datarray['verb'],strpos($datarray['verb'],'#')+1));
+ if(! $verb)
+ continue;
+ $xo = parse_xml_string($datarray['object'],false);
+
+ if(($xo->type == ACTIVITY_OBJ_PERSON) && ($xo->id)) {
+
+ // somebody was poked/prodded. Was it me?
+
+ $links = parse_xml_string("<links>".unxmlify($xo->link)."</links>",false);
+
+ foreach($links->link as $l) {
+ $atts = $l->attributes();
+ switch($atts['rel']) {
+ case "alternate":
+ $Blink = $atts['href'];
+ break;
+ default:
+ break;
+ }
+ }
+ if($Blink && link_compare($Blink,$a->get_baseurl() . '/profile/' . $importer['nickname'])) {
+
+ // send a notification
+ require_once('include/enotify.php');
+
+ notification(array(
+ 'type' => NOTIFY_POKE,
+ 'notify_flags' => $importer['notify-flags'],
+ 'language' => $importer['language'],
+ 'to_name' => $importer['username'],
+ 'to_email' => $importer['email'],
+ 'uid' => $importer['importer_uid'],
+ 'item' => $datarray,
+ 'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
+ 'source_name' => stripslashes($datarray['author-name']),
+ 'source_link' => $datarray['author-link'],
+ 'source_photo' => ((link_compare($datarray['author-link'],$importer['url']))
+ ? $importer['thumb'] : $datarray['author-avatar']),
+ 'verb' => $datarray['verb'],
+ 'otype' => 'person',
+ 'activity' => $verb,
+
+ ));
+ }
+ }
+ }
+
continue;
}
}