From c0eb7b10a3644ad207ca88dade2e9f53dd8f8aca Mon Sep 17 00:00:00 2001
From: Michael Vogel <icarus@dabo.de>
Date: Tue, 26 Jan 2016 12:18:57 +0100
Subject: [PATCH] Some new fields for the protocol

---
 include/dfrn.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/dfrn.php b/include/dfrn.php
index ee29e7347c..ac67bf0974 100644
--- a/include/dfrn.php
+++ b/include/dfrn.php
@@ -456,6 +456,9 @@ class dfrn {
 		$attributes = array("dfrn:updated" => $namdate);
 		xml_add_element($doc, $author, "uri", app::get_baseurl().'/profile/'.$owner["nickname"], $attributes);
 
+		$attributes = array("dfrn:updated" => $namdate);
+		xml_add_element($doc, $author, "dfrn:handle", $owner["addr"], $attributes);
+
 		$attributes = array("rel" => "photo", "type" => "image/jpeg", "dfrn:updated" => $picdate,
 					"media:width" => 175, "media:height" => 175, "href" => $owner['photo']);
 		xml_add_element($doc, $author, "link", "", $attributes);
@@ -560,6 +563,7 @@ class dfrn {
 		$author = $doc->createElement($element);
 		xml_add_element($doc, $author, "name", $contact["name"]);
 		xml_add_element($doc, $author, "uri", $contact["url"]);
+		xml_add_element($doc, $author, "dfrn:handle", $contact["addr"]);
 
 		/// @Todo
 		/// - Check real image type and image size
@@ -711,7 +715,9 @@ class dfrn {
 		if(($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri']) || (($item['thr-parent'] !== '') && ($item['thr-parent'] !== $item['uri']))) {
 			$parent = q("SELECT `guid` FROM `item` WHERE `id` = %d", intval($item["parent"]));
 			$parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']);
-			$attributes = array("ref" => $parent_item, "type" => "text/html", "href" => app::get_baseurl().'/display/'.$parent[0]['guid']);
+			$attributes = array("ref" => $parent_item, "type" => "text/html",
+						"href" => app::get_baseurl().'/display/'.$parent[0]['guid'],
+						"dfrn:diaspora_guid" => $parent[0]['guid']);
 			xml_add_element($doc, $entry, "thr:in-reply-to", "", $attributes);
 		}