diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9229986..d0517fe 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,9 @@
## Breaking changes
- `federation.outbound.handle_create_payload` parameter `to_user` is now optional. Public posts don't need a recipient. This also affects Diaspora protocol `build_send` method where the change is reflected similarly. [#43](https://github.com/jaywink/social-federation/pull/43)
- In practise this means the signature has changed for `handle_create_payload` and `build_send` from **`from_user, to_user, entity`** to **`entity, from_user, to_user=None`**.
+
+## Added
+- `Post.provider_display_name` is now supported in the entity outbound/inbound mappers. [#44](https://github.com/jaywink/social-federation/pull/44)
## [0.4.1] - 2016-09-04
diff --git a/federation/entities/diaspora/entities.py b/federation/entities/diaspora/entities.py
index 8119adf..a467ca6 100644
--- a/federation/entities/diaspora/entities.py
+++ b/federation/entities/diaspora/entities.py
@@ -37,7 +37,8 @@ class DiasporaPost(DiasporaEntityMixin, Post):
{'guid': self.guid},
{'diaspora_handle': self.handle},
{'public': 'true' if self.public else 'false'},
- {'created_at': format_dt(self.created_at)}
+ {'created_at': format_dt(self.created_at)},
+ {'provider_display_name': self.provider_display_name},
])
return element
diff --git a/federation/tests/entities/diaspora/test_entities.py b/federation/tests/entities/diaspora/test_entities.py
index 01c5515..e7e120f 100644
--- a/federation/tests/entities/diaspora/test_entities.py
+++ b/federation/tests/entities/diaspora/test_entities.py
@@ -7,14 +7,17 @@ from federation.entities.diaspora.entities import DiasporaComment, DiasporaPost,
class TestEntitiesConvertToXML(object):
def test_post_to_xml(self):
- entity = DiasporaPost(raw_content="raw_content", guid="guid", handle="handle", public=True)
+ entity = DiasporaPost(
+ raw_content="raw_content", guid="guid", handle="handle", public=True,
+ provider_display_name="Socialhome"
+ )
result = entity.to_xml()
assert result.tag == "status_message"
assert len(result.find("created_at").text) > 0
result.find("created_at").text = "" # timestamp makes testing painful
converted = b"raw_contentguid" \
b"handletrue" \
- b""
+ b"Socialhome"
assert etree.tostring(result) == converted
def test_comment_to_xml(self):
diff --git a/federation/tests/entities/diaspora/test_mappers.py b/federation/tests/entities/diaspora/test_mappers.py
index 0214276..1f6b965 100644
--- a/federation/tests/entities/diaspora/test_mappers.py
+++ b/federation/tests/entities/diaspora/test_mappers.py
@@ -23,6 +23,7 @@ class TestDiasporaEntityMappersReceive(object):
assert post.handle == "alice@alice.diaspora.example.org"
assert post.public == False
assert post.created_at == datetime(2011, 7, 20, 1, 36, 7)
+ assert post.provider_display_name == "Socialhome"
def test_message_to_objects_comment(self):
entities = message_to_objects(DIASPORA_POST_COMMENT)
diff --git a/federation/tests/fixtures/payloads.py b/federation/tests/fixtures/payloads.py
index ab0bda4..d3dab6f 100644
--- a/federation/tests/fixtures/payloads.py
+++ b/federation/tests/fixtures/payloads.py
@@ -36,6 +36,7 @@ DIASPORA_POST_SIMPLE = """
alice@alice.diaspora.example.org
false
2011-07-20 01:36:07 UTC
+ Socialhome