diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-05-16 21:52:30 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-05-20 10:47:40 +0200 |
commit | 083bf34a7763aec7c95282e1b357ee4cf71c49fd (patch) | |
tree | 0db342d89218e2e875e52b7148191ae4243d665f /src/ui/buffer.c | |
parent | 7d7f0ef5a5a40257996df52aaff58599fddd11d5 (diff) | |
download | profani-tty-083bf34a7763aec7c95282e1b357ee4cf71c49fd.tar.gz |
Start urlopen feature
Start https://github.com/profanity-im/profanity/issues/1340
Diffstat (limited to 'src/ui/buffer.c')
-rw-r--r-- | src/ui/buffer.c | 15 |
1 files changed, 15 insertions, 0 deletions
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) { |