From 1f6a96ecb41118642a0caa215763a44d2e564773 Mon Sep 17 00:00:00 2001 From: Pavel Kvach Date: Tue, 23 Apr 2024 21:03:41 +0300 Subject: [PATCH 1/3] ext: notifications: Add link logging for management of new comments in Stdout Fixes https://github.com/isso-comments/isso/issues/138 --- CHANGES.rst | 2 ++ isso/__init__.py | 2 +- isso/ext/notifications.py | 22 ++++++++++++++++++---- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 9997aad4..7c1e1302 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -33,6 +33,7 @@ Bugfixes & Improvements - Handle deleted comments in Disqus migration (`#994`_, pkvach) - Fix total comments count calculation (`#997`_, pkvach) - Fix newline character handling in data-isso-* i18n strings (`#992`_, pkvach) +- Add link logging for management of new comments in Stdout (`#1016`_, pkvach) .. _#951: https://github.com/posativ/isso/pull/951 .. _#967: https://github.com/posativ/isso/pull/967 @@ -42,6 +43,7 @@ Bugfixes & Improvements .. _#994: https://github.com/isso-comments/isso/pull/994 .. _#997: https://github.com/isso-comments/isso/pull/997 .. _#992: https://github.com/isso-comments/isso/pull/992 +.. _#1016: https://github.com/isso-comments/isso/pull/1016 0.13.1.dev0 (2023-02-05) ------------------------ diff --git a/isso/__init__.py b/isso/__init__.py index 68468de7..53d34c09 100644 --- a/isso/__init__.py +++ b/isso/__init__.py @@ -110,7 +110,7 @@ def __init__(self, conf): smtp_backend = False for backend in conf.getlist("general", "notify"): if backend == "stdout": - subscribers.append(Stdout(None)) + subscribers.append(Stdout(self)) elif backend in ("smtp", "SMTP"): smtp_backend = True else: diff --git a/isso/ext/notifications.py b/isso/ext/notifications.py index 1841f683..ee5a8886 100644 --- a/isso/ext/notifications.py +++ b/isso/ext/notifications.py @@ -22,6 +22,10 @@ from isso import local +def create_comment_action_url(uri, action, key): + return uri + "/" + action + "/" + key + + class SMTPConnection(object): def __init__(self, conf): @@ -118,10 +122,10 @@ def format(self, thread, comment, parent_comment, recipient=None, admin=False): uri = self.public_endpoint + "/id/%i" % comment["id"] key = self.isso.sign(comment["id"]) - rv.write("Delete comment: %s\n" % (uri + "/delete/" + key)) + rv.write("Delete comment: %s\n" % create_comment_action_url(uri, "delete", key)) if comment["mode"] == 2: - rv.write("Activate comment: %s\n" % (uri + "/activate/" + key)) + rv.write("Activate comment: %s\n" % create_comment_action_url(uri, "activate", key)) else: uri = self.public_endpoint + "/id/%i" % parent_comment["id"] @@ -208,8 +212,9 @@ def _retry(self, subject, body, to, headers): class Stdout(object): - def __init__(self, conf): - pass + def __init__(self, isso): + self.isso = isso + self.public_endpoint = isso.conf.get("server", "public-endpoint") or local("host") def __iter__(self): @@ -224,6 +229,15 @@ def _new_thread(self, thread): def _new_comment(self, thread, comment): logger.info("comment created: %s", json.dumps(comment)) + logger.info("Link to comment: %s" % (local("origin") + thread["uri"] + "#isso-%i" % comment["id"])) + + uri = self.public_endpoint + "/id/%i" % comment["id"] + key = self.isso.sign(comment["id"]) + + logger.info("Delete comment: %s" % create_comment_action_url(uri, "delete", key)) + + if comment["mode"] == 2: + logger.info("Activate comment: %s" % create_comment_action_url(uri, "activate", key)) def _edit_comment(self, comment): logger.info('comment %i edited: %s', From 388632faad237a3ba99f120950c25b5beae7d3b3 Mon Sep 17 00:00:00 2001 From: ix5 Date: Tue, 23 Apr 2024 23:29:06 +0200 Subject: [PATCH 2/3] docs/index: Disavow IE10 compat (Not-so) recent changes mean that Isso is no longer compatible --- docs/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.html b/docs/index.html index 9cbd99db..068269cd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -32,7 +32,7 @@

Configurable JS client

Embed a single JS file, 65kB (20kB gzipped) and you are done.

-

Supports Firefox, Safari, Chrome and IE10.

+

Supports Firefox, Safari, Chrome and Edge.

From 0ae94b4bd3a98eee0e3f0c42329b3f7041e303da Mon Sep 17 00:00:00 2001 From: ix5 Date: Mon, 29 Apr 2024 22:23:01 +0200 Subject: [PATCH 3/3] CHANGES: Document removed IE10 compat --- CHANGES.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 135ec84b..361ccb89 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -24,8 +24,11 @@ Breaking Changes every push to ``master``, while ``isso:release`` points to the latest stable release (`#970`_, janw). Previously, ``:latest`` pointed to the latest stable (tagged) version +- Disavow IE10 compatibility: (Not-so) recent changes mean that Isso is no + longer compatible (`#1022`, ix5) .. _#970: https://github.com/isso-comments/isso/pull/970 +.. _#1022: https://github.com/isso-comments/isso/pull/1022 Bugfixes & Improvements ^^^^^^^^^^^^^^^^^^^^^^^