Initial work on last-read-position feature

Print dashes on the position we last left off in a chat window.
So far the number of dashes is hardcoded, and the feature only works in
chat windows.

Regards https://github.com/profanity-im/profanity/issues/1238
This commit is contained in:
Michael Vetter
2019-12-13 12:05:24 +01:00
parent 9bb2d7f95e
commit 14f25992c3
6 changed files with 59 additions and 0 deletions

View File

@@ -106,6 +106,19 @@ buffer_append(ProfBuff buffer, const char show_char, int pad_indent, GDateTime *
buffer->entries = g_slist_append(buffer->entries, e);
}
void
buffer_remove_entry_by_id(ProfBuff buffer, const char *const id)
{
GSList *entries = buffer->entries;
while (entries) {
ProfBuffEntry *entry = entries->data;
if (entry->id && (g_strcmp0(entry->id, id) == 0)) {
buffer->entries = g_slist_delete_link(buffer->entries, entries);
}
entries = g_slist_next(entries);
}
}
gboolean
buffer_mark_received(ProfBuff buffer, const char *const id)
{