S

[PATCH] Allow getting enclosure data out of feed items

diff -r 2c9e95796371 sat/plugins/plugin_xep_0277.py
--- a/sat/plugins/plugin_xep_0277.py    Fri Jun 11 17:39:59 2021 +0200
+++ b/sat/plugins/plugin_xep_0277.py    Tue Aug 17 14:37:49 2021 +0000
@@ -423,6 +423,10 @@
                     comments_data["service"] = service.full()
                     comments_data["node"] = node
                 comments.append(comments_data)
+            elif link_elt.getAttribute("rel") == "enclosure":
+                if not "enclosure" in microblog_data:
+                    microblog_data["enclosure"] = []
+                microblog_data["enclosure"].append({ "href": link_elt["href"], "type": link_elt["type"], "title": link_elt["title"] })
             else:
                 rel = link_elt.getAttribute("rel", "")
G

goffi 30/09/2021, 15:23

Hello, thanks for the patch. There are a couple of issues for now, I can't merge it as it is: - please use merge-request feature, it's made for that and I need full coordinate (email, full name) to merge a patch (cf. https://salut-a-toi.org/__b/doc/backend/libervia-cli/merge-request.html#merge-request-create-and-manage-merge-requests for documentation) - enclosure is used by Movim and not described in XEP-0277, it's not even part of recent Atom specs. It should not be a blocking think to add it to Libervia, but it probably won't be in a `enclosure` key with a copy/paste of Atom attributes. This need to be more generic (we may move out of XEP-0277 at some point, and it would be nice to have minimal changes to do on frontends if this happen). - overall, this is something for 0.9, so I'll check that again after 0.8 is released I'm letting this ticket opened meanwhile.

id

397

author

Singpolyma

created

17/08/2021, 14:38

updated

17/08/2021, 14:38

labels
libervia-backend
type
feature request
status
queued
priority
normal
milestone
0.7
severity
normal