Browse Source

Set default queue size 512 for get_queue

Alois Mahdal 3 years ago
parent
commit
b489e7d819
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      src/imapdomo.lua

+ 3
- 2
src/imapdomo.lua View File

@@ -57,16 +57,17 @@ end
57 57
 -- mail getters                                                             --
58 58
 ------------------------------------------------------------------------------
59 59
 
60
-pkg.get_queue = function(acct, mbox)
60
+pkg.get_queue = function(acct, mbox, size)
61 61
     --
62 62
     -- Get queue from *mbox* from *acct* or nil (no messages)
63 63
     --
64 64
     -- If mbox is not specified, "FILTER_QUEUE" is used
65 65
     --
66 66
     mbox = mbox or "FILTER_QUEUE"
67
+    size = size or 512
67 68
     local exist = acct[mbox]:check_status()
68 69
     if exist > 0 then
69
-        return acct[mbox]:select_all()
70
+        return pkg.head(size, acct[mbox]:select_all())
70 71
     end
71 72
     return nil
72 73
 end