Add 'guid' and 'public_key' as required for DiasporaHCard generator

Leaving these out was a mistake in the initial implementation. Diaspora has these in at least 0.6 development branch.
merge-requests/130/head
Jason Robinson 2016-07-24 01:06:30 +03:00
rodzic 4c1c4d5e53
commit 3e73658d65
4 zmienionych plików z 89 dodań i 63 usunięć

Wyświetl plik

@ -4,6 +4,7 @@
- While in early stages, doing some renaming of modules to suit the longer term. `federation.controllers` has been split into two, `federation.outbound` and `federation.inbound`. The following methods have new import locations:
* `federation.controllers.handle_receive` -> `federation.inbound.handle_receive`
* `federation.controllers.handle_create_payload` -> `federation.outbound.handle_create_payload`
- Class `federation.hostmeta.generators.DiasporaHCard` now requires `guid`, `public_key` and `username` for initialization. Leaving these out was a mistake in the initial implementation. Diaspora has these in at least 0.6 development branch.
## Added
- `Relationship` base entity which represents relationships between two handles. Types can be following, sharing, ignoring and blocking. The Diaspora counterpart, `DiasporaRequest`, which represents a sharing/following request is outwards a single entity, but incoming a double entity, handled by creating both a sharing and following version of the relationship.
@ -17,6 +18,7 @@
### Fixes
- Fix fetching sender handle from Diaspora protocol private messages. As it is not contained in the header, it needs to be read from the message content itself.
- Fix various issues with `DiasporaHCard` template after comparing to some real world hCard templates from real pods. Old version was based on documentation in Diaspora project wiki.
## [0.3.2] - 2016-05-09

Wyświetl plik

@ -163,7 +163,7 @@ class DiasporaHCard(object):
"""
required = [
"hostname", "fullname", "firstname", "lastname", "photo300", "photo100", "photo50", "searchable",
"hostname", "fullname", "firstname", "lastname", "photo300", "photo100", "photo50", "searchable", "guid", "public_key", "username",
]
def __init__(self, **kwargs):

Wyświetl plik

@ -1,62 +1,83 @@
<div id='content'>
<h1>$fullname</h1>
<div id='content_inner'>
<div class='entity_profile vcard author' id='i'>
<h2>User profile</h2>
<dl class='entity_nickname'>
<dt>Nickname</dt>
<dd>
<a class='nickname url uid' href='$hostname' rel='me'>$fullname</a>
</dd>
</dl>
<dl class='entity_given_name'>
<dt>First name</dt>
<dd>
<span class='given_name'>$firstname</span>
</dd>
</dl>
<dl class='entity_family_name'>
<dt>Family name</dt>
<dd>
<span class='family_name'>$lastname</span>
</dd>
</dl>
<dl class='entity_fn'>
<dt>Full name</dt>
<dd>
<span class='fn'>$fullname</span>
</dd>
</dl>
<dl class='entity_url'>
<dt>URL</dt>
<dd>
<a class='url' href='$hostname' id='pod_location' rel='me'>$hostname</a>
</dd>
</dl>
<dl class='entity_photo'>
<dt>Photo</dt>
<dd>
<img class='photo avatar' height='300px' src='$photo300' width='300px'>
</dd>
</dl>
<dl class='entity_photo_medium'>
<dt>Photo</dt>
<dd>
<img class='photo avatar' height='100px' src='$photo100' width='100px'>
</dd>
</dl>
<dl class='entity_photo_small'>
<dt>Photo</dt>
<dd>
<img class='photo avatar' height='50px' src='$photo50' width='50px'>
</dd>
</dl>
<dl class='entity_searchable'>
<dt>Searchable</dt>
<dd>
<span class='searchable'>$searchable</span>
</dd>
</dl>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta charset="UTF-8" />
<title>$fullname</title>
</head>
<body>
<div id='content'>
<h1>$fullname</h1>
<div id='content_inner'>
<div class='entity_profile vcard author' id='i'>
<h2>User profile</h2>
<dl class="entity_uid">
<dt>Uid</dt>
<dd>
<span class="uid">$guid</span>
</dd>
</dl>
<dl class='entity_nickname'>
<dt>Nickname</dt>
<dd>
<span class="nickname">$username</span>
</dd>
</dl>
<dl class='entity_first_name'>
<dt>First name</dt>
<dd>
<span class='given_name'>$firstname</span>
</dd>
</dl>
<dl class='entity_family_name'>
<dt>Family name</dt>
<dd>
<span class='family_name'>$lastname</span>
</dd>
</dl>
<dl class='entity_full_name'>
<dt>Full name</dt>
<dd>
<span class='fn'>$fullname</span>
</dd>
</dl>
<dl class='entity_url'>
<dt>URL</dt>
<dd>
<a class='url' href='$hostname' id='pod_location' rel='me'>$hostname</a>
</dd>
</dl>
<dl class='entity_photo'>
<dt>Photo</dt>
<dd>
<img class='photo avatar' height='300px' src='$photo300' width='300px'>
</dd>
</dl>
<dl class='entity_photo_medium'>
<dt>Photo</dt>
<dd>
<img class='photo avatar' height='100px' src='$photo100' width='100px'>
</dd>
</dl>
<dl class='entity_photo_small'>
<dt>Photo</dt>
<dd>
<img class='photo avatar' height='50px' src='$photo50' width='50px'>
</dd>
</dl>
<dl class='entity_searchable'>
<dt>Searchable</dt>
<dd>
<span class='searchable'>$searchable</span>
</dd>
</dl>
<dl class="entity_key">
<dt>Key</dt>
<dd>
<pre class="key">$public_key
</pre>
</dd>
</dl>
</div>
</div>
</div>
</div>
</body>

Wyświetl plik

@ -68,7 +68,10 @@ class TestDiasporaHCardGenerator(object):
photo300="photo300",
photo100="photo100",
photo50="photo50",
searchable="searchable"
searchable="searchable",
guid="guid",
public_key="public_key",
username="username",
)
assert hcard == template
@ -88,7 +91,7 @@ class TestDiasporaHCardGenerator(object):
hostname="hostname",
fullname="fullname",
firstname="firstname",
username="username"
unknown="unknown"
)