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 +4 -4
- data/lib/diaspora_federation/entities/reshare.rb +14 -0
- data/lib/diaspora_federation/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69b26a0e6f05a364115daf455c348d72627c5577
|
4
|
+
data.tar.gz: accee3201502d60fff35a35d9902dc21a5935b35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|