1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-16 18:11:08 +01:00

Add support for XEP-0133: Service Administration

also extend Smack's integration test framework to use XEP-0133 as a
means for of throw away account creation.

Fixes SMACK-742
This commit is contained in:
Florian Schmaus 2016-11-27 21:14:44 +01:00
parent 1f1bc236fd
commit 274e5630c4
12 changed files with 414 additions and 56 deletions

View file

@ -326,6 +326,16 @@ public abstract class AdHocCommand {
return data.getStatus();
}
/**
* Check if this command has been completed successfully.
*
* @return <code>true</code> if this command is completed.
* @since 4.2
*/
public boolean isCompleted() {
return getStatus() == Status.completed;
}
/**
* Sets the data of the current stage. This should not used.
*

View file

@ -143,11 +143,18 @@ public class RemoteCommand extends AdHocCommand {
data.setForm(form.getDataFormToSend());
}
AdHocCommandData responseData = (AdHocCommandData) connection.createPacketCollectorAndSend(
data).nextResultOrThrow();
AdHocCommandData responseData = null;
try {
responseData = connection.createPacketCollectorAndSend(data).nextResultOrThrow();
}
finally {
// We set the response data in a 'finally' block, so that it also gets set even if an error IQ was returned.
if (responseData != null) {
this.sessionID = responseData.getSessionID();
super.setData(responseData);
}
}
this.sessionID = responseData.getSessionID();
super.setData(responseData);
}
@Override