Comparison

plugins/archive.lua @ 345:266a96ae4c0d

plugins.archive: Update for MAM 0.2
author Kim Alvefur <zash@zash.se>
date Sun, 30 Jun 2013 00:46:49 +0200
parent 305:4a0206505b9d
child 353:8cd05c3d0f1f
comparison
equal deleted inserted replaced
344:ea668c47e1bd 345:266a96ae4c0d
37 37
38 local results = {}; 38 local results = {};
39 local function handle_archived_message(message) 39 local function handle_archived_message(message)
40 local result_tag = message:get_child("result", xmlns_mam); 40 local result_tag = message:get_child("result", xmlns_mam);
41 if result_tag and result_tag.attr.queryid == queryid then 41 if result_tag and result_tag.attr.queryid == queryid then
42 local forwarded = message:get_child("forwarded", xmlns_forward); 42 local forwarded = result_tag:get_child("forwarded", xmlns_forward);
43 forwarded = forwarded or message:get_child("forwarded", xmlns_forward); -- COMPAT XEP-0313 pre 2013-05-31
43 44
44 local id = result_tag.attr.id; 45 local id = result_tag.attr.id;
45 local delay = forwarded:get_child("delay", xmlns_delay); 46 local delay = forwarded:get_child("delay", xmlns_delay);
46 local stamp = delay and parse_datetime(delay.attr.stamp) or nil; 47 local stamp = delay and parse_datetime(delay.attr.stamp) or nil;
47 48