mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-08 22:21:08 +01:00
Merge remote-tracking branch 'my/master'
This commit is contained in:
commit
b558a128c3
30 changed files with 203 additions and 136 deletions
|
|
@ -169,7 +169,7 @@ public final class BlockingCommandManager extends Manager {
|
|||
|
||||
BlockListIQ blockListIQ = new BlockListIQ();
|
||||
BlockListIQ blockListIQResult = connection().createPacketCollectorAndSend(blockListIQ).nextResultOrThrow();
|
||||
blockListCached = blockListIQResult.getJids();
|
||||
blockListCached = blockListIQResult.getBlockedJidsCopy();
|
||||
|
||||
return Collections.unmodifiableList(blockListCached);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.blocking.element;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -52,9 +53,10 @@ public class BlockListIQ extends IQ {
|
|||
public BlockListIQ(List<Jid> jids) {
|
||||
super(ELEMENT, NAMESPACE);
|
||||
if (jids == null) {
|
||||
jids = Collections.emptyList();
|
||||
this.jids = Collections.emptyList();
|
||||
} else {
|
||||
this.jids = Collections.unmodifiableList(jids);
|
||||
}
|
||||
this.jids = jids;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -65,14 +67,23 @@ public class BlockListIQ extends IQ {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the JIDs.
|
||||
* Get the JIDs as unmodifiable list.
|
||||
*
|
||||
* @return the JIDs
|
||||
* @return the blocked JIDs
|
||||
*/
|
||||
public List<Jid> getJids() {
|
||||
public List<Jid> getBlockedJids() {
|
||||
return jids;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a copy of the blocked list JIDs. This copy is modifiable.
|
||||
*
|
||||
* @return the blocked JIDs
|
||||
*/
|
||||
public List<Jid> getBlockedJidsCopy() {
|
||||
return new ArrayList<>(getBlockedJids());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
|
||||
if (jids.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
XMPPError.Builder error = XMPPError.from(XMPPError.Condition.item_not_found, errorMessage);
|
||||
IQ errorIQ = IQ.createErrorResponse(this.bytestreamRequest, error);
|
||||
this.manager.getConnection().sendStanza(errorIQ);
|
||||
throw new XMPPErrorException(error);
|
||||
throw new XMPPErrorException(errorIQ, error.build());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -615,6 +615,7 @@ public final class AdHocCommandManager extends Manager {
|
|||
* @return the command instance to execute.
|
||||
* @throws XMPPErrorException if there is problem creating the new instance.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
private LocalCommand newInstanceOfCmd(String commandNode, String sessionID) throws XMPPErrorException
|
||||
{
|
||||
AdHocCommandInfo commandInfo = commands.get(commandNode);
|
||||
|
|
|
|||
|
|
@ -95,8 +95,14 @@ public class AdHocCommandDataProvider extends IQProvider<AdHocCommandData> {
|
|||
adHocCommandData.setForm(dataFormProvider.parse(parser));
|
||||
}
|
||||
else if (parser.getName().equals("note")) {
|
||||
AdHocCommandNote.Type type = AdHocCommandNote.Type.valueOf(
|
||||
parser.getAttributeValue("", "type"));
|
||||
String typeString = parser.getAttributeValue("", "type");
|
||||
AdHocCommandNote.Type type;
|
||||
if (typeString != null) {
|
||||
type = AdHocCommandNote.Type.valueOf(typeString);
|
||||
} else {
|
||||
// Type is optional and 'info' if not present.
|
||||
type = AdHocCommandNote.Type.info;
|
||||
}
|
||||
String value = parser.nextText();
|
||||
adHocCommandData.addNote(new AdHocCommandNote(type, value));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ public final class FileTransferNegotiator extends Manager {
|
|||
|
||||
}
|
||||
else {
|
||||
throw new XMPPErrorException(iqResponse.getError());
|
||||
throw new XMPPErrorException(iqResponse, iqResponse.getError());
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,6 @@ public class ValidationConsistencyException extends IllegalArgumentException {
|
|||
* @param message
|
||||
*/
|
||||
public ValidationConsistencyException(String message) {
|
||||
super( message);
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue