diff --git a/boot.php b/boot.php
index 1dd539434..060a9e7cd 100644
--- a/boot.php
+++ b/boot.php
@@ -2661,7 +2661,7 @@ function parse_xml_string($s) {
$x = @simplexml_load_string($s2);
if(count(libxml_get_errors()))
foreach(libxml_get_errors() as $err)
- logger('libxml: parse: ' . $err, LOGGER_DATA);
+ logger('libxml: parse: ' . $err->code." at ".$err->line.":".$err->column." : ".$err->message, LOGGER_DATA);
libxml_clear_errors();
return $x;
}}
diff --git a/include/conversation.php b/include/conversation.php
index 0919419ec..a3b15146b 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -33,14 +33,33 @@ function localize_item(&$item){
}
if ($item['verb']=='http://activitystrea.ms/schema/1.0/make-friend'){
- $b = str_replace("[/url]","[/url]\n", $item['body']);
- preg_match_all("|(\[url.*\[/url\])|", $b, $match);
+ if ($item['object-type']=="" || $item['object-type']!='http://activitystrea.ms/schema/1.0/person') return;
+
+ $Aname = $item['author-name'];
+ $Alink = $item['author-link'];
+
+ $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
+
+ $obj = parse_xml_string($xmlhead.$item['object']);
+ $links = parse_xml_string($xmlhead."".unxmlify($obj->link)."");
+
+ $Bname = $obj->title;
+ $Blink = ""; $Bphoto = "";
+ foreach ($links->link as $l){
+ $atts = $l->attributes();
+ switch($atts['rel']){
+ case "alternate": $Blink = $atts['href'];
+ case "photo": $Bphoto = $atts['href'];
+ }
+
+ }
+
+ $A = '[url=' . $Alink . ']' . $Aname . '[/url]';
+ $B = '[url=' . $Blink . ']' . $Bname . '[/url]';
+ if ($Bphoto!="") $Bphoto = '[url=' . $Blink . '][img]' . $Bphoto . '[/img][/url]';
+
+ $item['body'] = sprintf(t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$Bphoto;
- $item['body'] = $match[0][0]." "
- .t('is now friends with')
- ." ".$match[0][1]."\n\n\n"
- .$match[0][2];
-
}
}
@@ -579,8 +598,8 @@ function item_photo_menu($item){
$menu = Array(
t("View status") => $status_link,
t("View profile") => $profile_link,
- t("View photos") => $photos_link,
- t("View recent") => $posts_link,
+ t("View photos") => $photos_link,
+ t("View recent") => $posts_link,
t("Edit contact") => $contact_url,
t("Send PM") => $pm_url,
);
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index 58473146d..7c28bf902 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -423,9 +423,11 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
$arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
$arr['verb'] = ACTIVITY_FRIEND;
$arr['object-type'] = ACTIVITY_OBJ_PERSON;
- $arr['body'] = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url] ' . t('is now friends with')
- . ' [url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' . "\n\n\n"
- . ' [url=' . $contact['url'] . ']' . '[img]' . $contact['thumb'] . '[/img][/url]';
+
+ $A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]';
+ $B = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
+ $BPhoto = '[url=' . $contact['url'] . ']' . '[img]' . $contact['thumb'] . '[/img][/url]';
+ $arr['body'] = sprintf(t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$Bphoto;
$arr['object'] = '