1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-11 01:59:38 +02:00

RC Release of JEP 55

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2844 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro 2005-09-19 14:44:02 +00:00 committed by derek
parent 64ac585dec
commit c9342aa169
3 changed files with 22 additions and 8 deletions

View file

@ -28,6 +28,7 @@ import java.util.List;
* @author Derek DeMoro
*/
class SimpleUserSearch extends IQ {
private Form form;
private ReportedData data;
@ -55,7 +56,7 @@ class SimpleUserSearch extends IQ {
form = Form.getFormFrom(this);
}
if(form == null){
if (form == null) {
return "";
}
@ -87,13 +88,14 @@ class SimpleUserSearch extends IQ {
List fields = new ArrayList();
while (!done) {
if(parser.getAttributeCount() > 0){
if (parser.getAttributeCount() > 0) {
String jid = parser.getAttributeValue("", "jid");
List valueList = new ArrayList();
valueList.add(jid);
ReportedData.Field field = new ReportedData.Field("jid", valueList);
fields.add(field);
}
int eventType = parser.next();
if (eventType == XmlPullParser.START_TAG && parser.getName().equals("item")) {
@ -112,9 +114,20 @@ class SimpleUserSearch extends IQ {
ReportedData.Field field = new ReportedData.Field(name, valueList);
fields.add(field);
boolean exists = false;
Iterator cols = data.getColumns();
while (cols.hasNext()) {
ReportedData.Column column = (ReportedData.Column) cols.next();
if (column.getVariable().equals(name)) {
exists = true;
}
}
// Column name should be the same
ReportedData.Column column = new ReportedData.Column(name, name, "text-single");
data.addColumn(column);
if (!exists) {
ReportedData.Column column = new ReportedData.Column(name, name, "text-single");
data.addColumn(column);
}
}
else if (eventType == XmlPullParser.END_TAG) {
if (parser.getName().equals("query")) {