Comparison

plugins/muc/muc.lib.lua @ 3506:0f46acca11cc

MUC: Fixed traceback on presence errors lacking a condition.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 27 Sep 2010 19:00:11 +0500
parent 3446:9c0b3cd890e9
child 3509:72cb8b6536b9
comparison
equal deleted inserted replaced
3505:eb2f36dc0369 3506:0f46acca11cc
241 return true; 241 return true;
242 end 242 end
243 243
244 local function build_unavailable_presence_from_error(stanza) 244 local function build_unavailable_presence_from_error(stanza)
245 local type, condition, text = stanza:get_error(); 245 local type, condition, text = stanza:get_error();
246 local error_message = "Kicked: "..condition:gsub("%-", " "); 246 local error_message = "Kicked: "..(condition and condition:gsub("%-", " ") or "presence error");
247 if text then 247 if text then
248 error_message = error_message..": "..text; 248 error_message = error_message..": "..text;
249 end 249 end
250 return st.presence({type='unavailable', from=stanza.attr.from, to=stanza.attr.to}) 250 return st.presence({type='unavailable', from=stanza.attr.from, to=stanza.attr.to})
251 :tag('status'):text(error_message); 251 :tag('status'):text(error_message);