From 083bf34a7763aec7c95282e1b357ee4cf71c49fd Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Sat, 16 May 2020 21:52:30 +0200 Subject: Start urlopen feature Start https://github.com/profanity-im/profanity/issues/1340 --- src/ui/buffer.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/ui/buffer.c') diff --git a/src/ui/buffer.c b/src/ui/buffer.c index 54178632..9b7d3f14 100644 --- a/src/ui/buffer.c +++ b/src/ui/buffer.c @@ -162,6 +162,21 @@ buffer_get_entry_by_id(ProfBuff buffer, const char *const id) return NULL; } +ProfBuffEntry* +buffer_get_url(ProfBuff buffer, const char *const id) +{ + GSList *entries = buffer->entries; + while (entries) { + ProfBuffEntry *entry = entries->data; + if (strstr(entry->message, "http://")) { + return entry; + } + entries = g_slist_next(entries); + } + + return NULL; +} + static void _free_entry(ProfBuffEntry *entry) { -- cgit 1.4.1-2-gfad0