# HG changeset patch # User Jonas Schäfer # Date 1620484308 -7200 # Node ID 21217f7e82b978848e97a977112dc772625250b1 # Parent cb5748f94840ea27403387aa5c1eb51a10c140dd 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. diff -r cb5748f94840 -r 21217f7e82b9 util/stanza.lua --- 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;