From 5813c25e1dfccfb6010a9356bca8de74ae52679b Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Fri, 18 Mar 2022 15:01:14 +0000 Subject: [PATCH] Regex get replies based on href Before we used the results after, but it wasn't as efficient FossilOrigin-Name: 1b014f011eaaffe7a29f7fdb4c86fa91cd43f386c9f69241b5b822ec171a4690 --- src/reply.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/reply.c b/src/reply.c index 6a2eb92..31eb747 100644 --- a/src/reply.c +++ b/src/reply.c @@ -45,7 +45,13 @@ char* construct_post_box(char* reply_id, return reply_html; } -#define REGEX_REPLY "@(.*?)<\\/span>" +/* Some comments: + * - Misskey does not return , but we still regex to make sure it's a highlight + * - The order of parameters in a tag can be changed (mastodon does this), + * so we just grep for regex href + * - Misskey/Mastodon adds an @ symbol in the href param, while pleroma adds /users + */ +#define REGEX_REPLY "@(?:)?.*?(?:<\\/span>)?" #define REGEX_RESULTS_LEN 9 char* reply_status(char* id, struct mstdnt_status* status)