Changeset

11574:21217f7e82b9

util.stanza: add at_top helper This allows the user to detect whether the cursor is currently at the top of the stanza. This will be used by util.xmppstream to be able to port it over.
author Jonas Schäfer <jonas@wielicki.name>
date Sat, 08 May 2021 16:31:48 +0200
parents 11573:cb5748f94840
children 11575:76d32b2ca5eb
files util/stanza.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/stanza.lua	Thu May 20 14:00:54 2021 +0200
+++ b/util/stanza.lua	Sat May 08 16:31:48 2021 +0200
@@ -136,6 +136,10 @@
 	return self;
 end
 
+function stanza_mt:at_top()
+	return self.last_add == nil or #self.last_add == 0
+end
+
 function stanza_mt:reset()
 	self.last_add = nil;
 	return self;