summaryrefslogtreecommitdiffstats
blob: 13ab1a0184d48c329448c866bd64ebb1484426c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- Querying the archive for messages 
-- Usage: ./sluift MAMSimple.lua <jid> <password> <query_dest>

sluift.debug = true

c = sluift.new_client(arg[1], arg[2])

c:connect();

c:set_mam{mam={}, to=arg[3]}

c:for_each_message(function(e)
	if e.payloads[1].tag == 'fin' then return true end
	if e.payloads[1]._type == 'mam_result' then
		print(e.payloads[1].payload.stanza.payloads[1].text)
	end
end)

c:disconnect()