`_
for further information.
**What's missing?**
diff --git a/docs/index.html b/docs/index.html
index 1a9ed453..9cbd99db 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -42,13 +42,13 @@
Links
Help
Join #isso
via Matrix
or via IRC on Libera.Chat,
- or ask a question on GitHub Discussions.
+ or ask a question on GitHub Discussions.
Contribute
diff --git a/isso/isso.cfg b/isso/isso.cfg
index 3827a61b..fec23829 100644
--- a/isso/isso.cfg
+++ b/isso/isso.cfg
@@ -127,7 +127,7 @@ trusted-proxies =
# By default, isso will set SameSite=None when served over https and
# SameSite=Lax when served over http.
# See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
-# and https://github.com/posativ/isso/issues/682
+# and https://github.com/isso-comments/isso/issues/682
# Accepted values: None, Lax, Strict
samesite =
diff --git a/isso/js/app/api.js b/isso/js/app/api.js
index 86a01092..90efa492 100644
--- a/isso/js/app/api.js
+++ b/isso/js/app/api.js
@@ -22,7 +22,7 @@ if (! endpoint) {
for (i = 0; i < js.length; i++) {
if (js[i].getAttribute("async") || js[i].getAttribute("defer")) {
throw "Isso's automatic configuration detection failed, please " +
- "refer to https://github.com/posativ/isso#client-configuration " +
+ "refer to https://github.com/isso-comments/isso#client-configuration " +
"and add a custom `data-isso` attribute.";
}
}
diff --git a/isso/js/tests/unit/template-comment-newlines.test.js b/isso/js/tests/unit/template-comment-newlines.test.js
index 3a5943f7..00afe5a4 100644
--- a/isso/js/tests/unit/template-comment-newlines.test.js
+++ b/isso/js/tests/unit/template-comment-newlines.test.js
@@ -10,8 +10,8 @@
"use strict";
/* Test rendered code blocks inside "comment" template
- * See https://github.com/posativ/isso/discussions/856
- * and https://github.com/posativ/isso/pull/857
+ * See https://github.com/isso-comments/isso/discussions/856
+ * and https://github.com/isso-comments/isso/pull/857
*/
// Set up our document body
diff --git a/isso/tests/disqus.xml b/isso/tests/disqus.xml
index 6475270a..9af1ab60 100644
--- a/isso/tests/disqus.xml
+++ b/isso/tests/disqus.xml
@@ -79,7 +79,7 @@
+ reported by waqqasdadabhoy in https://github.com/isso-comments/isso/issues/728 -->
redacted
diff --git a/package.json b/package.json
index ad2f2e2f..1e7f9d7f 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"author": "Martin Zimmermann",
"description": "lightweight Disquis alternative",
"license": "MIT",
- "repository": "github:posativ/isso",
+ "repository": "github:isso-comments/isso",
"scripts": {
"test": "jest --config isso/js/jest.config.js isso/js/tests/",
"test-unit": "jest --config isso/js/jest-unit.config.js isso/js/tests/unit/",
diff --git a/setup.py b/setup.py
index 86820778..882f9d71 100755
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@
packages=find_packages(),
include_package_data=True,
zip_safe=False,
- url='https://github.com/posativ/isso/',
+ url='https://github.com/isso-comments/isso/',
license='MIT',
description='lightweight Disqus alternative',
long_description=long_description,
From 6dffaa74f1184280f45a8bf64730f3d153c74b05 Mon Sep 17 00:00:00 2001
From: Pavel Kvach
Date: Mon, 18 Mar 2024 21:28:23 +0200
Subject: [PATCH 3/3] isso: migrate: Handle deleted comments in Disqus
migration (#994)
* isso: migrate: Handle deleted comments in Disqus migration
Fixes https://github.com/posativ/isso/issues/979
---
CHANGES.rst | 2 ++
isso/db/comments.py | 2 +-
isso/migrate.py | 7 +++++--
isso/tests/disqus.xml | 33 +++++++++++++++++++++++++++++++++
isso/tests/test_migration.py | 7 +++++--
5 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/CHANGES.rst b/CHANGES.rst
index 4534eb1a..718368a9 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -26,12 +26,14 @@ Bugfixes & Improvements
- Make language code handling more robust (`#983`_, ix5)
- Prevent auto creation of invalid links in comments (`#995`_, pkvach)
- Fix W3C Validation issues (`#999`_, pkvach)
+- Handle deleted comments in Disqus migration (`#994`_, pkvach)
.. _#951: https://github.com/posativ/isso/pull/951
.. _#967: https://github.com/posativ/isso/pull/967
.. _#983: https://github.com/posativ/isso/pull/983
.. _#995: https://github.com/isso-comments/isso/pull/995
.. _#999: https://github.com/isso-comments/isso/pull/999
+.. _#994: https://github.com/isso-comments/isso/pull/994
0.13.1.dev0 (2023-02-05)
------------------------
diff --git a/isso/db/comments.py b/isso/db/comments.py
index 60379924..9bed6f0b 100644
--- a/isso/db/comments.py
+++ b/isso/db/comments.py
@@ -38,7 +38,7 @@ def __init__(self, db):
'CREATE TABLE IF NOT EXISTS comments (',
' tid REFERENCES threads(id), id INTEGER PRIMARY KEY, parent INTEGER,',
' created FLOAT NOT NULL, modified FLOAT, mode INTEGER, remote_addr VARCHAR,',
- ' text VARCHAR, author VARCHAR, email VARCHAR, website VARCHAR,',
+ ' text VARCHAR NOT NULL, author VARCHAR, email VARCHAR, website VARCHAR,',
' likes INTEGER DEFAULT 0, dislikes INTEGER DEFAULT 0, voters BLOB NOT NULL,',
' notification INTEGER DEFAULT 0);'])
try:
diff --git a/isso/migrate.py b/isso/migrate.py
index 038c910e..5123c432 100644
--- a/isso/migrate.py
+++ b/isso/migrate.py
@@ -92,10 +92,11 @@ def migrate(self):
for post in tree.findall(Disqus.ns + 'post'):
email = post.find('{0}author/{0}email'.format(Disqus.ns))
ip = post.find(Disqus.ns + 'ipAddress')
+ comment_text = post.find(Disqus.ns + 'message').text or ''
item = {
'dsq:id': post.attrib.get(Disqus.internals + 'id'),
- 'text': post.find(Disqus.ns + 'message').text,
+ 'text': comment_text,
'author': post.find('{0}author/{0}name'.format(Disqus.ns)).text,
'email': email.text if email is not None else '',
'created': mktime(strptime(
@@ -146,11 +147,13 @@ def migrate(self):
continue
email = post.find("{0}author/{0}email".format(Disqus.ns))
+ comment_text = post.find(Disqus.ns + 'message').text or ''
+
print(" * {0} by {1} <{2}>".format(
post.attrib.get(Disqus.internals + "id"),
post.find("{0}author/{0}name".format(Disqus.ns)).text,
email.text if email is not None else ""))
- print(textwrap.fill(post.find(Disqus.ns + "message").text,
+ print(textwrap.fill(comment_text,
initial_indent=" ", subsequent_indent=" "))
print("")
diff --git a/isso/tests/disqus.xml b/isso/tests/disqus.xml
index 9af1ab60..d8d09740 100644
--- a/isso/tests/disqus.xml
+++ b/isso/tests/disqus.xml
@@ -113,4 +113,37 @@
+
+
+
+
+ 2013-10-10T19:20:29Z
+ true
+ false
+
+ foo@bar.com
+ peter
+ true
+
+ 127.0.0.1
+
+
+
+
+
+ Hello, World.
]]>
+ 2013-10-11T06:52:33Z
+ false
+ false
+
+ foo@bar.com
+ user
+ false
+ user
+
+ 127.0.0.1
+
+
+
+
diff --git a/isso/tests/test_migration.py b/isso/tests/test_migration.py
index ff5f55f0..78fc6844 100644
--- a/isso/tests/test_migration.py
+++ b/isso/tests/test_migration.py
@@ -56,7 +56,7 @@ def test_disqus_empty_id_workaround(self):
Disqus(db, xml, empty_id=True).migrate()
self.assertEqual(
- len(db.execute("SELECT id FROM comments").fetchall()), 3)
+ len(db.execute("SELECT id FROM comments").fetchall()), 5)
self.assertEqual(db.threads["/"]["title"], "Hello, World!")
self.assertEqual(db.threads["/"]["id"], 1)
@@ -67,9 +67,12 @@ def test_disqus_empty_id_workaround(self):
self.assertEqual(a["email"], "foo@bar.com")
self.assertEqual(a["remote_addr"], "127.0.0.0")
- b = db.comments.get(2)
+ b = db.comments.get(3)
self.assertEqual(b["parent"], a["id"])
+ deleted_comment = db.comments.get(2)
+ self.assertEqual(deleted_comment["text"], "")
+
def test_wordpress(self):
xml = join(dirname(__file__), "wordpress.xml")