diff --git a/src/main.c b/src/main.c
index 4bc3d95..da580c8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -95,9 +95,9 @@ int main(void)
{ "/lists/edit/:", list_edit },
{ "/lists/for/:", content_tl_list },
{ "/lists", content_lists },
+ { "/local", content_tl_local },
{ "/federated", content_tl_federated },
{ "/direct", content_tl_direct },
- { "/local", content_tl_local },
{ "/bookmarks", content_account_bookmarks },
{ "/favourites", content_account_favourites },
{ "/blocked", content_account_blocked },
diff --git a/src/status.c b/src/status.c
index 217825a..b5a6103 100644
--- a/src/status.c
+++ b/src/status.c
@@ -499,7 +499,7 @@ char* reformat_status(struct session* ssn,
return res;
}
-#define REGEX_MENTION ""
+#define REGEX_MENTION "(?="
char* make_mentions_local(char* content)
{
@@ -512,11 +512,12 @@ char* make_mentions_local(char* content)
size_t res_len = 1024;
char* res = malloc(res_len);
pcre2_code* re = pcre2_compile((PCRE2_SPTR)REGEX_MENTION,
- PCRE2_ZERO_TERMINATED, 0,
+ PCRE2_ZERO_TERMINATED, PCRE2_MULTILINE,
&error, &erroffset, NULL);
if (re == NULL)
{
- fprintf(stderr, "Couldn't parse regex at offset %ld: %d\n", erroffset, error);
+ char* v;
+ easprintf(&v, "Couldn't parse regex at offset %d: %s\n", error, REGEX_MENTION + erroffset);
pcre2_code_free(re);
return NULL;
}
@@ -554,8 +555,12 @@ char* make_mentions_local(char* content)
res = realloc(res, res_len);
break;
default:
+ {
+ char buf[256];
+ pcre2_get_error_message(rc, buf, 256);
goto out;
}
+ }
}
else
substitute_success = 1;
diff --git a/src/timeline.c b/src/timeline.c
index d1b07bd..b05e7ba 100644
--- a/src/timeline.c
+++ b/src/timeline.c
@@ -186,8 +186,8 @@ void tl_public(struct session* ssn, mastodont_t* api, int local, enum base_categ
struct mstdnt_storage storage = { 0 };
struct mstdnt_timeline_args args = {
- .with_muted = 1,
- .local = local,
+ .with_muted = MSTDNT_TRUE,
+ .local = local ? MSTDNT_TRUE : MSTDNT_FALSE,
.remote = 0,
// Converts to `enum mstdnt_reply_visibility' nicely
.reply_visibility = (ssn->post.replies_only.is_set ?