Comparison

mod_csi_battery_saver/mod_csi_battery_saver.lua @ 3490:972b21d34306

mod_csi_battery_saver: fix typo in util.stanza:get_child()
author tmolitor <thilo@eightysoft.de>
date Mon, 18 Mar 2019 21:26:06 +0100
parent 3481:1c8612d8db55
child 3633:6b0db0f2d57a
comparison
equal deleted inserted replaced
3489:33b3f02a9e7d 3490:972b21d34306
23 -- Returns nil if the message is not a carbon 23 -- Returns nil if the message is not a carbon
24 local function extract_carbon(stanza) 24 local function extract_carbon(stanza)
25 local carbon = stanza:child_with_ns("urn:xmpp:carbons:2") or stanza:child_with_ns("urn:xmpp:carbons:1"); 25 local carbon = stanza:child_with_ns("urn:xmpp:carbons:2") or stanza:child_with_ns("urn:xmpp:carbons:1");
26 if not carbon then return; end 26 if not carbon then return; end
27 local direction = carbon.name == "sent" and "out" or "in"; 27 local direction = carbon.name == "sent" and "out" or "in";
28 local forward = carbon:get_child("urn:xmpp:forward:0", "forwarded"); 28 local forward = carbon:get_child("forwarded", "urn:xmpp:forward:0");
29 local message = forward and forward:child_with_name("message") or nil; 29 local message = forward and forward:child_with_name("message") or nil;
30 if not message then return; end 30 if not message then return; end
31 return message, direction; 31 return message, direction;
32 end 32 end
33 33