Comparison

plugins/roster.lua @ 276:3d8442f7f034

plugins.roster: Make stanza error parts locals.
author Kim Alvefur <zash@zash.se>
date Fri, 27 Jan 2012 18:52:25 +0100
parent 271:c9d8628a61cc
child 380:0891b4e27766
comparison
equal deleted inserted replaced
275:c077b20ad59f 276:3d8442f7f034
73 stream:send_iq(stanza, function (reply) 73 stream:send_iq(stanza, function (reply)
74 if not callback then return end 74 if not callback then return end
75 if reply.attr.type == "result" then 75 if reply.attr.type == "result" then
76 callback(true); 76 callback(true);
77 else 77 else
78 type, condition, text = reply:get_error(); 78 local type, condition, text = reply:get_error();
79 callback(nil, { type, condition, text }); 79 callback(nil, { type, condition, text });
80 end 80 end
81 end); 81 end);
82 end 82 end
83 -- What about subscriptions? 83 -- What about subscriptions?
92 function (reply) 92 function (reply)
93 if not callback then return end 93 if not callback then return end
94 if reply.attr.type == "result" then 94 if reply.attr.type == "result" then
95 callback(true); 95 callback(true);
96 else 96 else
97 type, condition, text = reply:get_error(); 97 local type, condition, text = reply:get_error();
98 callback(nil, { type, condition, text }); 98 callback(nil, { type, condition, text });
99 end 99 end
100 end); 100 end);
101 end 101 end
102 102
124 end 124 end
125 roster.ver = query.attr.ver or ""; 125 roster.ver = query.attr.ver or "";
126 end 126 end
127 callback(roster); 127 callback(roster);
128 else 128 else
129 type, condition, text = stanza:get_error(); 129 local type, condition, text = stanza:get_error();
130 callback(nil, { type, condition, text }); --FIXME 130 callback(nil, { type, condition, text }); --FIXME
131 end 131 end
132 end); 132 end);
133 end 133 end
134 134