1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-23 04:57:58 +01:00

Remove nullOrEmpty check for setSessionID()

in AdHocCommandData.

This check was added in 3a37b71e19, but a
session ID can be null, if it's the first invocation. This prevented
RemoteCommand.execute() from executing, since RemoteCommand's sessionID
member will be null at the first invocation.
This commit is contained in:
Florian Schmaus 2014-10-16 13:02:06 +02:00
parent 9edf06e1bb
commit 888de7e1c1

View file

@ -19,7 +19,6 @@ package org.jivesoftware.smackx.commands.packet;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.XmlStringBuilder;
import org.jivesoftware.smackx.commands.AdHocCommand;
import org.jivesoftware.smackx.commands.AdHocCommand.Action;
@ -224,10 +223,16 @@ public class AdHocCommandData extends IQ {
return executeAction;
}
/**
* Set the 'sessionid' attribute of the command.
* <p>
* This value can be null or empty for the first command, but MUST be set for subsequent commands. See also <a
* href="http://xmpp.org/extensions/xep-0050.html#impl-session">XEP-0050 § 3.3 Session Lifetime</a>.
* </p>
*
* @param sessionID
*/
public void setSessionID(String sessionID) {
if (StringUtils.isNullOrEmpty(sessionID)) {
throw new IllegalArgumentException("session id must not be null or empty");
}
this.sessionID = sessionID;
}