You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2021/10/05 16:42:14 UTC

[incubator-ponymail-foal] branch master updated: Cut away query string for now.

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new d4a3ddf  Cut away query string for now.
d4a3ddf is described below

commit d4a3ddfeec0d6a338126488f911b8fd2e2711e84
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Oct 5 18:42:03 2021 +0200

    Cut away query string for now.
---
 webui/js/ponymail.js      | 4 ++++
 webui/js/source/primer.js | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index 2b01992..3a9f96c 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -3352,6 +3352,10 @@ function parseURL(state) {
 function parse_permalink() {
     // message id is the bit after the last /
     let mid = location.href.split('/').pop();
+    // Cut off any query string there might be
+    if (mid.match(/\?/)) {
+        mid = mid.replace(/\?.*$/, '');
+    }
     init_preferences(); // blank call to load defaults like social rendering
     GET('%sapi/preferences.lua'.format(apiURL), init_preferences, null);
     // Fetch the thread data and pass to build_single_thread
diff --git a/webui/js/source/primer.js b/webui/js/source/primer.js
index fb13860..c3f7cc7 100644
--- a/webui/js/source/primer.js
+++ b/webui/js/source/primer.js
@@ -142,6 +142,10 @@ function parseURL(state) {
 function parse_permalink() {
     // message id is the bit after the last /
     let mid = location.href.split('/').pop();
+    // Cut off any query string there might be
+    if (mid.match(/\?/)) {
+        mid = mid.replace(/\?.*$/, '');
+    }
     init_preferences(); // blank call to load defaults like social rendering
     GET('%sapi/preferences.lua'.format(apiURL), init_preferences, null);
     // Fetch the thread data and pass to build_single_thread