fix "friend of" message in ping.php
This commit is contained in:
parent
ec4061e6fe
commit
ae024edbf9
1 changed files with 15 additions and 9 deletions
24
mod/ping.php
24
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'] ) );
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue