diff --git a/CHANGELOG.md b/CHANGELOG.md
index 54f2b3f..4510564 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,6 +26,10 @@
 
   Parameter `to_user` is now `to_user_key` and thus instead of an object containing the `key` attribute it should now be an RSA public key object instance. This simplifies things since we only need the key from the user, nothing else.
 
+* Switch Diaspora protocol to send new style entities ([related issue](https://github.com/jaywink/federation/issues/59))
+
+  We've already accepted these on incoming payloads for a long time and so do all the other platforms now, so now we always send out entities with the new property names. This can break federation with really old servers that don't understand these keys yet. 
+
 ### Fixed
 
 * Change unquote method used when preparing Diaspora XML payloads for verification ([related issue](https://github.com/jaywink/federation/issues/115))
diff --git a/federation/entities/diaspora/entities.py b/federation/entities/diaspora/entities.py
index 8dd47d7..691e1c1 100644
--- a/federation/entities/diaspora/entities.py
+++ b/federation/entities/diaspora/entities.py
@@ -117,7 +117,7 @@ class DiasporaComment(DiasporaRelayableMixin, Comment):
             {"author_signature": self.signature},
             {"parent_author_signature": self.parent_signature},
             {"text": self.raw_content},
-            {"diaspora_handle": self.handle},
+            {"author": self.handle},
             {"created_at": format_dt(self.created_at)},
         ])
         return element
@@ -131,9 +131,9 @@ class DiasporaPost(DiasporaEntityMixin, Post):
         """Convert to XML message."""
         element = etree.Element(self._tag_name)
         struct_to_xml(element, [
-            {"raw_message": self.raw_content},
+            {"text": self.raw_content},
             {"guid": self.guid},
-            {"diaspora_handle": self.handle},
+            {"author": self.handle},
             {"public": "true" if self.public else "false"},
             {"created_at": format_dt(self.created_at)},
             {"provider_display_name": self.provider_display_name},
@@ -150,13 +150,13 @@ class DiasporaLike(DiasporaRelayableMixin, Reaction):
         """Convert to XML message."""
         element = etree.Element(self._tag_name)
         struct_to_xml(element, [
-            {"target_type": "Post"},
+            {"parent_type": "Post"},
             {"guid": self.guid},
             {"parent_guid": self.target_guid},
             {"author_signature": self.signature},
             {"parent_author_signature": self.parent_signature},
             {"positive": "true"},
-            {"diaspora_handle": self.handle},
+            {"author": self.handle},
         ])
         return element
 
@@ -203,7 +203,7 @@ class DiasporaProfile(DiasporaEntityMixin, Profile):
         """Convert to XML message."""
         element = etree.Element(self._tag_name)
         struct_to_xml(element, [
-            {"diaspora_handle": self.handle},
+            {"author": self.handle},
             {"first_name": self.name},
             {"last_name": ""},  # Not used in Diaspora modern profiles
             {"image_url": self.image_urls["large"]},
@@ -289,7 +289,7 @@ class DiasporaReshare(DiasporaEntityMixin, Share):
             {"provider_display_name": self.provider_display_name},
             {"public": "true" if self.public else "false"},
             # Some of our own not in Diaspora protocol
-            {"raw_content": self.raw_content},
+            {"text": self.raw_content},
             {"entity_type": self.entity_type},
         ])
         return element

Fix outgoing Diaspora entity names according to new spec
Some of the entities we build for Diaspora XML messages are based on the old protocol version which we don't intend to fully support. Since Diaspora 0.6 already understands these new names, we can safely send them out by breaking only pre-0.6 compatibility.

See these changes from old to new: diaspora/diaspora_federation#29 + documentation of entities http://diaspora.github.io/diaspora_federation/entities/
diff --git a/federation/tests/entities/diaspora/test_entities.py b/federation/tests/entities/diaspora/test_entities.py
index 0d4e3d1..2d6d733 100644
--- a/federation/tests/entities/diaspora/test_entities.py
+++ b/federation/tests/entities/diaspora/test_entities.py
@@ -24,8 +24,8 @@ class TestEntitiesConvertToXML:
         assert result.tag == "status_message"
         assert len(result.find("created_at").text) > 0
         result.find("created_at").text = ""  # timestamp makes testing painful
-        converted = b"<status_message><raw_message>raw_content</raw_message><guid>guid</guid>" \
-                    b"<diaspora_handle>handle</diaspora_handle><public>true</public><created_at>" \
+        converted = b"<status_message><text>raw_content</text><guid>guid</guid>" \
+                    b"<author>handle</author><public>true</public><created_at>" \
                     b"</created_at><provider_display_name>Socialhome</provider_display_name></status_message>"
         assert etree.tostring(result) == converted
 
@@ -40,7 +40,7 @@ class TestEntitiesConvertToXML:
         result.find("created_at").text = ""  # timestamp makes testing painful
         converted = b"<comment><guid>guid</guid><parent_guid>target_guid</parent_guid>" \
                     b"<author_signature>signature</author_signature><parent_author_signature>" \
-                    b"</parent_author_signature><text>raw_content</text><diaspora_handle>handle</diaspora_handle>" \
+                    b"</parent_author_signature><text>raw_content</text><author>handle</author>" \
                     b"<created_at></created_at></comment>"
         assert etree.tostring(result) == converted
 
@@ -48,9 +48,9 @@ class TestEntitiesConvertToXML:
         entity = DiasporaLike(guid="guid", target_guid="target_guid", handle="handle", signature="signature")
         result = entity.to_xml()
         assert result.tag == "like"
-        converted = b"<like><target_type>Post</target_type><guid>guid</guid><parent_guid>target_guid</parent_guid>" \
+        converted = b"<like><parent_type>Post</parent_type><guid>guid</guid><parent_guid>target_guid</parent_guid>" \
                     b"<author_signature>signature</author_signature><parent_author_signature>" \
-                    b"</parent_author_signature><positive>true</positive><diaspora_handle>handle</diaspora_handle>" \
+                    b"</parent_author_signature><positive>true</positive><author>handle</author>" \
                     b"</like>"
         assert etree.tostring(result) == converted
 
@@ -71,7 +71,7 @@ class TestEntitiesConvertToXML:
         )
         result = entity.to_xml()
         assert result.tag == "profile"
-        converted = b"<profile><diaspora_handle>bob@example.com</diaspora_handle>" \
+        converted = b"<profile><author>bob@example.com</author>" \
                     b"<first_name>Bob Bobertson</first_name><last_name></last_name><image_url>urllarge</image_url>" \
                     b"<image_url_small>urlsmall</image_url_small><image_url_medium>urlmedium</image_url_medium>" \
                     b"<gender></gender><bio>foobar</bio><location></location><searchable>true</searchable>" \
@@ -102,7 +102,7 @@ class TestEntitiesConvertToXML:
         result.find("created_at").text = ""  # timestamp makes testing painful
         converted = "<reshare><author>%s</author><guid>%s</guid><created_at></created_at><root_author>%s" \
                     "</root_author><root_guid>%s</root_guid><provider_display_name>%s</provider_display_name>" \
-                    "<public>%s</public><raw_content>%s</raw_content><entity_type>%s</entity_type></reshare>" % (
+                    "<public>%s</public><text>%s</text><entity_type>%s</entity_type></reshare>" % (
                         entity.handle, entity.guid, entity.target_handle, entity.target_guid,
                         entity.provider_display_name, "true" if entity.public else "false", entity.raw_content,
                         entity.entity_type,
diff --git a/federation/tests/entities/diaspora/test_utils.py b/federation/tests/entities/diaspora/test_utils.py
index 8794b03..e4e9b38 100644
--- a/federation/tests/entities/diaspora/test_utils.py
+++ b/federation/tests/entities/diaspora/test_utils.py
@@ -29,8 +29,8 @@ class TestGetFullXMLRepresentation:
         entity = Post()
         document = get_full_xml_representation(entity, "")
         document = re.sub(r"<created_at>.*</created_at>", "", document)  # Dates are annoying to compare
-        assert document == "<XML><post><status_message><raw_message></raw_message><guid></guid>" \
-                           "<diaspora_handle></diaspora_handle><public>false</public>" \
+        assert document == "<XML><post><status_message><text></text><guid></guid>" \
+                           "<author></author><public>false</public>" \
                            "<provider_display_name></provider_display_name></status_message></post></XML>"
 
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-warnings
apt-get update apt-get install -y gcc
3.6
dev-requirements.txt
py.test --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
arrow==1.2.3
attrs==22.2.0
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
codecov==2.1.13
colorama==0.4.5
commonmark==0.9.1
coverage==6.2
cssselect==1.1.0
dirty-validators==0.5.4
Django==2.0.13
docutils==0.18.1
factory-boy==3.2.1
Faker==14.2.1
-e git+https://github.com/jaywink/federation.git@aa8e8a79607f305f33baab76cb77669f27cc6861#egg=federation
freezegun==1.2.2
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
isodate==0.6.1
Jinja2==3.0.3
jsonschema==3.2.0
livereload==2.6.3
lxml==5.3.1
MarkupSafe==2.0.1
packaging==21.3
pluggy==1.0.0
py==1.11.0
pycrypto==2.6.1
Pygments==2.14.0
pyparsing==3.1.4
pyrsistent==0.18.0
pytest==7.0.1
pytest-cov==4.0.0
pytest-django==4.5.2
pytest-warnings==0.3.1
python-dateutil==2.9.0.post0
python-xrd==0.1
pytz==2025.2
recommonmark==0.7.1
requests==2.27.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-autobuild==2021.3.14
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==1.2.3
tornado==6.1
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: federation
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - arrow==1.2.3
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - codecov==2.1.13
      - colorama==0.4.5
      - commonmark==0.9.1
      - coverage==6.2
      - cssselect==1.1.0
      - dirty-validators==0.5.4
      - django==2.0.13
      - docutils==0.18.1
      - factory-boy==3.2.1
      - faker==14.2.1
      - freezegun==1.2.2
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - isodate==0.6.1
      - jinja2==3.0.3
      - jsonschema==3.2.0
      - livereload==2.6.3
      - lxml==5.3.1
      - markupsafe==2.0.1
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pycrypto==2.6.1
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pyrsistent==0.18.0
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - pytest-django==4.5.2
      - pytest-warnings==0.3.1
      - python-dateutil==2.9.0.post0
      - python-xrd==0.1
      - pytz==2025.2
      - recommonmark==0.7.1
      - requests==2.27.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-autobuild==2021.3.14
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==1.2.3
      - tornado==6.1
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/federation

federation/tests/entities/diaspora/test_entities.py::TestEntitiesConvertToXML::test_post_to_xml federation/tests/entities/diaspora/test_entities.py::TestEntitiesConvertToXML::test_comment_to_xml federation/tests/entities/diaspora/test_entities.py::TestEntitiesConvertToXML::test_like_to_xml federation/tests/entities/diaspora/test_entities.py::TestEntitiesConvertToXML::test_profile_to_xml federation/tests/entities/diaspora/test_entities.py::TestEntitiesConvertToXML::test_reshare_to_xml federation/tests/entities/diaspora/test_utils.py::TestGetFullXMLRepresentation::test_returns_xml_document
federation/tests/entities/diaspora/test_entities.py::TestEntitiesConvertToXML::test_request_to_xml federation/tests/entities/diaspora/test_entities.py::TestEntitiesConvertToXML::test_retraction_to_xml federation/tests/entities/diaspora/test_entities.py::TestEntitiesConvertToXML::test_contact_to_xml federation/tests/entities/diaspora/test_entities.py::TestEntityAttributes::test_comment_ids federation/tests/entities/diaspora/test_entities.py::TestEntityAttributes::test_contact_ids federation/tests/entities/diaspora/test_entities.py::TestEntityAttributes::test_like_ids federation/tests/entities/diaspora/test_entities.py::TestEntityAttributes::test_post_ids federation/tests/entities/diaspora/test_entities.py::TestEntityAttributes::test_profile_ids federation/tests/entities/diaspora/test_entities.py::TestEntityAttributes::test_request_ids federation/tests/entities/diaspora/test_entities.py::TestEntityAttributes::test_reshare_ids federation/tests/entities/diaspora/test_entities.py::TestEntityAttributes::test_retraction_ids federation/tests/entities/diaspora/test_entities.py::TestDiasporaProfileFillExtraAttributes::test_raises_if_no_handle federation/tests/entities/diaspora/test_entities.py::TestDiasporaProfileFillExtraAttributes::test_calls_retrieve_and_parse_profile federation/tests/entities/diaspora/test_entities.py::TestDiasporaRetractionEntityConverters::test_entity_type_from_remote federation/tests/entities/diaspora/test_entities.py::TestDiasporaRetractionEntityConverters::test_entity_type_to_remote federation/tests/entities/diaspora/test_entities.py::TestDiasporaRelayableMixin::test_signing_comment_works federation/tests/entities/diaspora/test_entities.py::TestDiasporaRelayableMixin::test_signing_like_works federation/tests/entities/diaspora/test_entities.py::TestDiasporaRelayableMixin::test_sign_with_parent federation/tests/entities/diaspora/test_entities.py::TestDiasporaRelayableEntityValidate::test_raises_if_no_sender_key federation/tests/entities/diaspora/test_entities.py::TestDiasporaRelayableEntityValidate::test_calls_verify_signature federation/tests/entities/diaspora/test_utils.py::TestGetBaseAttributes::test_get_base_attributes_returns_only_intended_attributes federation/tests/entities/diaspora/test_utils.py::TestFormatDt::test_formatted_string_returned_from_tz_aware_datetime federation/tests/entities/diaspora/test_utils.py::test_add_element_to_doc
federation/entities/diaspora/entities.py CHANGELOG.md
federation/entities/diaspora/entities.py CHANGELOG.md