mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 17:46:22 +00:00
Start urlopen feature
Start https://github.com/profanity-im/profanity/issues/1340
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -73,5 +73,6 @@ int buffer_size(ProfBuff buffer);
|
||||
ProfBuffEntry* buffer_get_entry(ProfBuff buffer, int entry);
|
||||
ProfBuffEntry* buffer_get_entry_by_id(ProfBuff buffer, const char *const id);
|
||||
gboolean buffer_mark_received(ProfBuff buffer, const char *const id);
|
||||
ProfBuffEntry* buffer_get_url(ProfBuff buffer, const char *const id);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user