*
* @param packet the packet used for reporting data.
*/
public static ReportedData getReportedDataFrom(Packet packet) {
// Check if the packet includes the DataForm extension
PacketExtension packetExtension = packet.getExtension("x","jabber:x:data");
if (packetExtension != null) {
// Check if the existing DataForm is a result of a search
DataForm dataForm = (DataForm) packetExtension;
if (dataForm.getReportedData() != null)
return new ReportedData(dataForm);