Merge pull request #1374 from profanity-im/revampUrlopen

Rework /url and /executable for filetypes
This commit is contained in:
Michael Vetter
2020-07-02 11:26:18 +02:00
committed by GitHub
8 changed files with 433 additions and 59 deletions

View File

@@ -2067,12 +2067,18 @@ void
cons_executable_setting(void)
{
char *avatar = prefs_get_string(PREF_AVATAR_CMD);
cons_show("Avatar command (/executable avatar) : %s", avatar);
cons_show("Default '/avatar open' command (/executable avatar) : %s", avatar);
prefs_free_string(avatar);
char *exec = prefs_get_string(PREF_URL_OPEN_CMD);
cons_show("urlopen command (/executable urlopen) : %s", exec);
prefs_free_string(exec);
//TODO: there needs to be a way to get all the "locales"/schemes so we can
//display the defualt openers for all filetypes
gchar **urlopen = prefs_get_string_list_with_option(PREF_URL_OPEN_CMD, "");
cons_show("Default '/url open' command (/executable urlopen) : %s", urlopen[1]);
g_strfreev(urlopen);
char *urlsave = prefs_get_string(PREF_URL_SAVE_CMD);
cons_show("Default '/url save' command (/executable urlsave) : %s", urlsave);
g_free(urlsave);
}
void

View File

@@ -1156,7 +1156,7 @@ wins_add_urls_ac(const ProfWin *const win, const ProfMessage *const message)
GRegex *regex;
GMatchInfo *match_info;
regex = g_regex_new("https?://\\S+", 0, 0, NULL);
regex = g_regex_new("(https?|aesgcm)://\\S+", 0, 0, NULL);
g_regex_match (regex, message->plain, 0, &match_info);
while (g_match_info_matches (match_info))