aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-09-26 12:14:48 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2011-09-26 12:14:48 +0200
commitae024edbf9d9210126902b241bf9b7d2dbece1ec (patch)
tree6095b90733294a3f7727cb25e7c90a666fd1a803 /mod
parentec4061e6feb5be540136cf79ea4cbd048ae4d047 (diff)
downloadvolse-hubzilla-ae024edbf9d9210126902b241bf9b7d2dbece1ec.tar.gz
volse-hubzilla-ae024edbf9d9210126902b241bf9b7d2dbece1ec.tar.bz2
volse-hubzilla-ae024edbf9d9210126902b241bf9b7d2dbece1ec.zip
fix "friend of" message in ping.php
Diffstat (limited to 'mod')
-rw-r--r--mod/ping.php24
1 files changed, 15 insertions, 9 deletions
diff --git a/mod/ping.php b/mod/ping.php
index 38a32744d..d11af2e0e 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -14,7 +14,7 @@ function ping_init(&$a) {
$friends = array();
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`,
- `item`.`author-link`, `item`.`author-avatar`, `item`.`created`,
+ `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`,
`pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`
FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent`
WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND
@@ -25,13 +25,16 @@ function ping_init(&$a) {
$network = count($r);
foreach ($r as $it) {
switch($it['verb']){
- case 'http://activitystrea.ms/schema/1.0/like':
+ case ACTIVITY_LIKE:
$likes[] = $it;
break;
- case 'http://activitystrea.ms/schema/1.0/dislike':
+ case ACTIVITY_DISLIKE:
$dislikes[] = $it;
break;
- case 'http://activitystrea.ms/schema/1.0/make-friend':
+ case ACTIVITY_FRIEND:
+ $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
+ $obj = parse_xml_string($xmlhead.$it['object']);
+ $it['fname'] = $obj->title;
$friends[] = $it;
break;
default:
@@ -41,7 +44,7 @@ function ping_init(&$a) {
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`,
- `item`.`author-link`, `item`.`author-avatar`, `item`.`created`,
+ `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`,
`pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`
FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent`
WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND
@@ -51,13 +54,16 @@ function ping_init(&$a) {
$home = count($r);
foreach ($r as $it) {
switch($it['verb']){
- case 'http://activitystrea.ms/schema/1.0/like':
+ case ACTIVITY_LIKE:
$likes[] = $it;
break;
- case 'http://activitystrea.ms/schema/1.0/dislike':
+ case ACTIVITY_DISLIKE:
$dislikes[] = $it;
break;
- case 'http://activitystrea.ms/schema/1.0/make-friend':
+ case ACTIVITY_FRIEND:
+ $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
+ $obj = parse_xml_string($xmlhead.$it['object']);
+ $it['fname'] = $obj->title;
$friends[] = $it;
break;
default:
@@ -154,7 +160,7 @@ function ping_init(&$a) {
}
if (count($friends)){
foreach ($friends as $i) {
- echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} is now friend with %s"), $i['pname'] ) );
+ echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} is now friend with %s"), $i['fname'] ) );
};
}