# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1373372822 -7200
# Node ID 3ee83c4801b49c0b3ccdd7fccd9657216a44d49d
# Parent  1aaf30b457a0fa86e67a7d1c0bc575a329ed73e4
clix.archive: Fix pagination message, rsm.first is a table

diff -r 1aaf30b457a0 -r 3ee83c4801b4 clix/archive.lua
--- a/clix/archive.lua	Mon Jul 08 13:15:07 2013 +0200
+++ b/clix/archive.lua	Tue Jul 09 14:27:02 2013 +0200
@@ -56,7 +56,13 @@
 					conn:query_archive(opts.to, opts, handle_results);
 					return
 				else
-					conn:info("Next page: --%s=%s", reverse and "before" or "after", result[reverse and "first" or "last"]);
+					local whatnext, nextpage = reverse and "before" or "after";
+					if reverse then
+						nextpage = result.first and result.first[1];
+					else
+						nextpage = result.last;
+				end
+					conn:info("Next page: --%s=%s", whatnext, nextpage);
 				end
 			end
 			conn:close();