[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon 5621b2df84 56/63: add underscores to user-like ur
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon 5621b2df84 56/63: add underscores to user-like url regexes |
Date: |
Sun, 4 Aug 2024 04:00:44 -0400 (EDT) |
branch: elpa/mastodon
commit 5621b2df84802fca40ea5461308f601aeb9b361a
Author: marty hiatt <martianhiatus@riseup.net>
Commit: marty hiatt <martianhiatus@riseup.net>
add underscores to user-like url regexes
---
lisp/mastodon.el | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index c77170500c..cd32a2dc7a 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -414,24 +414,27 @@ not, just browse the URL in the normal fashion."
"Check if QUERY resembles a fediverse URL."
;; calqued off
https://github.com/tuskyapp/Tusky/blob/c8fc2418b8f5458a817bba221d025b822225e130/app/src/main/java/com/keylesspalace/tusky/BottomSheetActivity.kt
;; thx to Conny Duck!
+ ;; mastodon at least seems to allow only [a-z0-9_] for usernames, plus "."
+ ;; but not at beginning or end, see
https://github.com/mastodon/mastodon/issues/6830
+ ;; objects may have - in them
(let* ((uri-parsed (url-generic-parse-url query))
(query (url-filename uri-parsed)))
(save-match-data
(or (string-match "^/@[^/]+$" query)
(string-match "^/@[^/]+/[[:digit:]]+$" query)
- (string-match "^/user[s]?/@?[[:alnum:]]+$" query) ; @: pleroma or
soapbox
+ (string-match "^/user[s]?/@?[[:alnum:]_]+$" query) ; @: pleroma or
soapbox
(string-match "^/notice/[[:alnum:]]+$" query)
(string-match "^/objects/[-a-f0-9]+$" query)
(string-match "^/notes/[a-z0-9]+$" query)
(string-match "^/display/[-a-f0-9]+$" query)
- (string-match "^/profile/[[:alpha:]]+$" query)
- (string-match "^/p/[[:alpha:]]+/[[:digit:]]+$" query)
- (string-match "^/[[:alpha:]]+$" query)
- (string-match "^/u/[[:alpha:]]+$" query)
- (string-match "^/c/[[:alnum:]]+$" query)
+ (string-match "^/profile/[[:alpha:]_]+$" query)
+ (string-match "^/p/[[:alpha:]_]+/[[:digit:]]+$" query)
+ (string-match "^/[[:alpha:]_]+$" query)
+ (string-match "^/u/[[:alpha:]_]+$" query)
+ (string-match "^/c/[[:alnum:]_]+$" query)
(string-match "^/post/[[:digit:]]+$" query)
(string-match "^/comment/[[:digit:]]+$" query) ; lemmy
- (string-match "^/user[s]?/[[:alnum:]]+/statuses/[[:digit:]]+$"
query) ; hometown
+ (string-match "^/user[s]?/[[:alnum:]_]+/statuses/[[:digit:]]+$"
query) ; hometown
(string-match "^/notes/[[:alnum:]]+$" query))))) ; misskey post
(defun mastodon-live-buffers ()
- [nongnu] elpa/mastodon dd1b0ab770 42/63: add mastodon-tl--fold-post, (continued)
- [nongnu] elpa/mastodon dd1b0ab770 42/63: add mastodon-tl--fold-post, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 30b02296ca 48/63: fix where we leave point on (un)folding, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 8d6983667d 51/63: refactor toot--toggle-bookmark, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon da0e348bc7 61/63: Revert "multisession var in -toot.el", ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 45903de823 63/63: info update, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 3f9b305b5f 24/63: flymake, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon bb1b33e2fb 39/63: toot.el: use mastodon-toot--base-toot-or-item-json, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon e66ce7b6fb 52/63: folding comments / action docstring, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 4ac5b57ae6 62/63: Merge branch 'develop', ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon f8ee682bb4 36/63: flip an if clause, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 5621b2df84 56/63: add underscores to user-like url regexes,
ELPA Syncer <=