diaspora_federation 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f071a159d911e2981ecdd64fb43a6b35818517f5
4
- data.tar.gz: 4b134feae0ef5815171db1bfda9535f50f83307b
3
+ metadata.gz: 69b26a0e6f05a364115daf455c348d72627c5577
4
+ data.tar.gz: accee3201502d60fff35a35d9902dc21a5935b35
5
5
  SHA512:
6
- metadata.gz: 8b721717d3f9e6464adaeb94f4c590633cab55b5877219048ea0ee21a0bee8112297e268a5d29f1557af145e35becce6a71696a13e8d30f6b7324a1cedf5867d
7
- data.tar.gz: 42b735837e07a028b3317045e82d1971fe786dfbb80df597ada691070800899935da49d349d80667624d13d78024bc73ca8f781b7d17fb177e61568ff1306058
6
+ metadata.gz: 0443a2e34f0d7805ae7e59edb85d4f63eb9c0639033d749f5050c8ef7d52aba2f88b5dcda4c76a495ea42c82ceb3470f605fe36861b73266e89964b8b8f279c6
7
+ data.tar.gz: 991d0a6307601a92a1b9dc3cd9127c58fe6c3a5a14448a1242d32d2d07f704759a0c7a1e83b936a7f09f563ca7d9837fa7b09f0f3aac828625eac5ca77ad2d94
@@ -27,6 +27,20 @@ module DiasporaFederation
27
27
  def to_s
28
28
  "#{super}:#{root_guid}"
29
29
  end
30
+
31
+ # fetch and receive root post from remote, if not available locally.
32
+ def fetch_root
33
+ root = DiasporaFederation.callbacks.trigger(:fetch_related_entity, "Post", root_guid)
34
+ Federation::Fetcher.fetch_public(root_author, "Post", root_guid) unless root
35
+ end
36
+
37
+ # Fetch root post after parse.
38
+ # @see Entity.populate_entity
39
+ # @param [Nokogiri::XML::Element] root_node xml nodes
40
+ # @return [Entity] instance
41
+ private_class_method def self.populate_entity(root_node)
42
+ super(root_node).tap(&:fetch_root)
43
+ end
30
44
  end
31
45
  end
32
46
  end
@@ -1,4 +1,4 @@
1
1
  module DiasporaFederation
2
2
  # the gem version
3
- VERSION = "0.1.0".freeze
3
+ VERSION = "0.1.1".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diaspora_federation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Neff