mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 22:32:06 +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:
parent
9edf06e1bb
commit
888de7e1c1
1 changed files with 9 additions and 4 deletions
|
@ -19,7 +19,6 @@ package org.jivesoftware.smackx.commands.packet;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.PacketExtension;
|
import org.jivesoftware.smack.packet.PacketExtension;
|
||||||
import org.jivesoftware.smack.util.StringUtils;
|
|
||||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||||
import org.jivesoftware.smackx.commands.AdHocCommand;
|
import org.jivesoftware.smackx.commands.AdHocCommand;
|
||||||
import org.jivesoftware.smackx.commands.AdHocCommand.Action;
|
import org.jivesoftware.smackx.commands.AdHocCommand.Action;
|
||||||
|
@ -224,10 +223,16 @@ public class AdHocCommandData extends IQ {
|
||||||
return executeAction;
|
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) {
|
public void setSessionID(String sessionID) {
|
||||||
if (StringUtils.isNullOrEmpty(sessionID)) {
|
|
||||||
throw new IllegalArgumentException("session id must not be null or empty");
|
|
||||||
}
|
|
||||||
this.sessionID = sessionID;
|
this.sessionID = sessionID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue