mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
implement DBus submitRateLimitChallenge method (#763)
update documentation
This commit is contained in:
parent
26594dd0ee
commit
d4838bd646
3 changed files with 25 additions and 1 deletions
|
@ -363,8 +363,14 @@ uploadStickerPack(stickerPackPath<s>) -> url<s>::
|
|||
|
||||
Exception: Failure
|
||||
|
||||
== Signals
|
||||
submitRateLimitChallenge(challenge<s>, captcha<s>) -> <>::
|
||||
* challenge : The challenge token taken from the proof required error.
|
||||
* captcha : The captcha token from the solved captcha on the Signal website..
|
||||
Can be used to lift some rate-limits by solving a captcha.
|
||||
|
||||
Exception: IOErrorException
|
||||
|
||||
== Signalss
|
||||
SyncMessageReceived (timestamp<x>, sender<s>, destination<s>, groupId<ay>,message<s>, attachments<as>)::
|
||||
The sync message is received when the user sends a message from a linked device.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.asamk;
|
||||
|
||||
import org.asamk.signal.commands.exceptions.IOErrorException;
|
||||
|
||||
import org.freedesktop.dbus.DBusPath;
|
||||
import org.freedesktop.dbus.annotations.DBusProperty;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
|
@ -141,6 +143,8 @@ public interface Signal extends DBusInterface {
|
|||
|
||||
String uploadStickerPack(String stickerPackPath) throws Error.Failure;
|
||||
|
||||
void submitRateLimitChallenge(String challenge, String captchaString) throws IOErrorException;
|
||||
|
||||
class MessageReceived extends DBusSignal {
|
||||
|
||||
private final long timestamp;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package org.asamk.signal.dbus;
|
||||
|
||||
import org.asamk.Signal;
|
||||
import org.asamk.Signal.Error;
|
||||
import org.asamk.signal.BaseConfig;
|
||||
import org.asamk.signal.commands.exceptions.IOErrorException;
|
||||
import org.asamk.signal.manager.AttachmentInvalidException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.NotMasterDeviceException;
|
||||
|
@ -81,6 +83,18 @@ public class DbusSignalImpl implements Signal {
|
|||
return m.getSelfNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void submitRateLimitChallenge(String challenge, String captchaString) throws IOErrorException {
|
||||
final var captcha = captchaString == null ? null : captchaString.replace("signalcaptcha://", "");
|
||||
|
||||
try {
|
||||
m.submitRateLimitRecaptchaChallenge(challenge, captcha);
|
||||
} catch (IOException e) {
|
||||
throw new IOErrorException("Submit challenge error: " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDevice(String uri) {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue