uploadStickerPath returns String

also, any zip file must be in the same directory as the manifest.json

update documentation
This commit is contained in:
John Freed 2021-08-20 06:42:56 +02:00
parent d8e5ab5f20
commit e193bafb8c
3 changed files with 6 additions and 5 deletions

View file

@ -457,8 +457,9 @@ verifyWithPin(number<s>, verificationCode<s>, pin<s>) -> <>::
Exception: Failure, InvalidNumber
uploadStickerPack(stickerPackPath<s>) -> <>::
* stickerPackPath : Path to the sticker pack zip file or manifest.json file
uploadStickerPack(stickerPackPath<s>) -> url<s>::
* stickerPackPath : Path to the manifest.json file or a zip file in the same directory
* url : URL of sticker pack after successful upload
Exception: Failure

View file

@ -245,7 +245,7 @@ public interface Signal extends DBusInterface {
void joinGroup(final String groupLink) throws Error.Failure;
void uploadStickerPack(String stickerPackPath) throws Error.Failure;
String uploadStickerPack(String stickerPackPath) throws Error.Failure;
class MessageReceived extends DBusSignal {

View file

@ -1595,11 +1595,11 @@ public class DbusSignalImpl implements Signal {
}
@Override
public void uploadStickerPack(String stickerPackPath) {
public String uploadStickerPack(String stickerPackPath) {
File path = new File(stickerPackPath);
try {
var url = m.uploadStickerPack(path);
return m.uploadStickerPack(path);
} catch (IOException e) {
throw new Error.Failure("Upload error (maybe image size is too large):" + e.getMessage());
} catch (StickerPackInvalidException e) {