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.
--- 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;