Software /
code /
prosody
Comparison
plugins/muc/muc.lib.lua @ 5086:1ef9aa0c9fb0
MUC: Fix a traceback caused by private IQ result and error stanzas where the encoded id can't be processed.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 09 Aug 2012 07:17:25 +0500 |
parent | 5078:cba0b426b542 |
child | 5144:a30507061526 |
comparison
equal
deleted
inserted
replaced
5085:cbc7eb5cfa8c | 5086:1ef9aa0c9fb0 |
---|---|
523 end | 523 end |
524 elseif not current_nick then -- not in room | 524 elseif not current_nick then -- not in room |
525 if type == "error" or type == "result" and stanza.name == "iq" then | 525 if type == "error" or type == "result" and stanza.name == "iq" then |
526 local id = stanza.attr.id; | 526 local id = stanza.attr.id; |
527 stanza.attr.from, stanza.attr.to, stanza.attr.id = deconstruct_stanza_id(self, stanza); | 527 stanza.attr.from, stanza.attr.to, stanza.attr.id = deconstruct_stanza_id(self, stanza); |
528 self:_route_stanza(stanza); | 528 if stanza.attr.id then |
529 self:_route_stanza(stanza); | |
530 end | |
529 stanza.attr.from, stanza.attr.to, stanza.attr.id = from, to, id; | 531 stanza.attr.from, stanza.attr.to, stanza.attr.id = from, to, id; |
530 else | 532 else |
531 origin.send(st.error_reply(stanza, "cancel", "not-acceptable")); | 533 origin.send(st.error_reply(stanza, "cancel", "not-acceptable")); |
532 end | 534 end |
533 elseif stanza.name == "message" and type == "groupchat" then -- groupchat messages not allowed in PM | 535 elseif stanza.name == "message" and type == "groupchat" then -- groupchat messages not allowed in PM |
547 stanza.attr.from, stanza.attr.to, stanza.attr.id = deconstruct_stanza_id(self, stanza); | 549 stanza.attr.from, stanza.attr.to, stanza.attr.id = deconstruct_stanza_id(self, stanza); |
548 end | 550 end |
549 if type == 'get' and stanza.tags[1].attr.xmlns == 'vcard-temp' then | 551 if type == 'get' and stanza.tags[1].attr.xmlns == 'vcard-temp' then |
550 stanza.attr.to = jid_bare(stanza.attr.to); | 552 stanza.attr.to = jid_bare(stanza.attr.to); |
551 end | 553 end |
552 self:_route_stanza(stanza); | 554 if stanza.attr.id then |
555 self:_route_stanza(stanza); | |
556 end | |
553 stanza.attr.from, stanza.attr.to, stanza.attr.id = from, to, id; | 557 stanza.attr.from, stanza.attr.to, stanza.attr.id = from, to, id; |
554 else -- message | 558 else -- message |
555 stanza.attr.from = current_nick; | 559 stanza.attr.from = current_nick; |
556 for jid in pairs(o_data.sessions) do | 560 for jid in pairs(o_data.sessions) do |
557 stanza.attr.to = jid; | 561 stanza.attr.to = jid; |