Comparison

plugins/muc/muc.lib.lua @ 9532:9bb33edd7255

MUC: Add function to retrieve affiliation data for a given JID
author Matthew Wild <mwild1@gmail.com>
date Sun, 21 Oct 2018 16:18:10 +0100
parent 9531:f2d70dc13700
child 9547:a06419532efb
comparison
equal deleted inserted replaced
9531:f2d70dc13700 9532:9bb33edd7255
1344 }); 1344 });
1345 1345
1346 return true; 1346 return true;
1347 end 1347 end
1348 1348
1349 function room_mt:get_affiliation_data(jid, key)
1350 local data = self._affiliation_data[jid];
1351 if not data then return nil; end
1352 if key then
1353 return data[key];
1354 end
1355 return data;
1356 end
1357
1349 function room_mt:get_role(nick) 1358 function room_mt:get_role(nick)
1350 local occupant = self:get_occupant_by_nick(nick); 1359 local occupant = self:get_occupant_by_nick(nick);
1351 return occupant and occupant.role or nil; 1360 return occupant and occupant.role or nil;
1352 end 1361 end
1353 1362