Skip to content

Commit

Permalink
Merge branch 'isso-comments:master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
mgc8 authored Apr 29, 2024
2 parents 04dc7b9 + 16dce51 commit 560d40c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -38,6 +41,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
Expand All @@ -47,6 +51,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)
------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<p><strong>Configurable JS client</strong></p>
<p>Embed a single JS file, 65kB (20kB gzipped) and you are
done.</p>
<p>Supports Firefox, Safari, Chrome and IE10.</p>
<p>Supports Firefox, Safari, Chrome and Edge.</p>
</li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion isso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
22 changes: 18 additions & 4 deletions isso/ext/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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):

Expand All @@ -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',
Expand Down

0 comments on commit 560d40c

Please sign in to comment.