mirror of
https://github.com/ErnyTech-Archive/JTDLib
synced 2024-11-11 13:59:22 +01:00
protected to public
This commit is contained in:
parent
6949f35fcb
commit
0d00748f0f
@ -42,7 +42,7 @@ public class EasyClient {
|
|||||||
* Creates a new EasyClient.
|
* Creates a new EasyClient.
|
||||||
* @param authorizationHandler Callback to be implemented in the client to manage the authorization.
|
* @param authorizationHandler Callback to be implemented in the client to manage the authorization.
|
||||||
*/
|
*/
|
||||||
protected EasyClient(AuthorizationHandler authorizationHandler) {
|
public EasyClient(AuthorizationHandler authorizationHandler) {
|
||||||
Log.setVerbosityLevel(1);
|
Log.setVerbosityLevel(1);
|
||||||
this.authorizationHandler = authorizationHandler;
|
this.authorizationHandler = authorizationHandler;
|
||||||
this.handlers.put(0L, new TdCallback(response -> {}, error -> {}, () -> {}));
|
this.handlers.put(0L, new TdCallback(response -> {}, error -> {}, () -> {}));
|
||||||
@ -54,7 +54,7 @@ public class EasyClient {
|
|||||||
* @param function TDLib API function representing a request to TDLib.
|
* @param function TDLib API function representing a request to TDLib.
|
||||||
* @return Request identifier. Responses to TDLib requests will have the same id as the corresponding request.
|
* @return Request identifier. Responses to TDLib requests will have the same id as the corresponding request.
|
||||||
*/
|
*/
|
||||||
protected long send(TdApi.Function function) {
|
public long send(TdApi.Function function) {
|
||||||
var requestId = this.requestId.getAndIncrement();
|
var requestId = this.requestId.getAndIncrement();
|
||||||
this.clientActor.request(new Request(requestId, function));
|
this.clientActor.request(new Request(requestId, function));
|
||||||
return requestId;
|
return requestId;
|
||||||
@ -66,7 +66,7 @@ public class EasyClient {
|
|||||||
* @param receiveCallback Interface of callback for receive incoming update or request response.
|
* @param receiveCallback Interface of callback for receive incoming update or request response.
|
||||||
* @param errorCallback Interface of callback for receive incoming error response.
|
* @param errorCallback Interface of callback for receive incoming error response.
|
||||||
*/
|
*/
|
||||||
protected void execute(TdApi.Function function, ReceiveCallback receiveCallback, ErrorCallback errorCallback) {
|
public void execute(TdApi.Function function, ReceiveCallback receiveCallback, ErrorCallback errorCallback) {
|
||||||
while (true) {
|
while (true) {
|
||||||
if (haveAuthorization) {
|
if (haveAuthorization) {
|
||||||
break;
|
break;
|
||||||
@ -82,7 +82,7 @@ public class EasyClient {
|
|||||||
* @param function TDLib API function representing a request to TDLib.
|
* @param function TDLib API function representing a request to TDLib.
|
||||||
* @return A response to a request.
|
* @return A response to a request.
|
||||||
*/
|
*/
|
||||||
protected Response execute(TdApi.Function function) {
|
public Response execute(TdApi.Function function) {
|
||||||
var responseAtomicReference = new AtomicReference<Response>();
|
var responseAtomicReference = new AtomicReference<Response>();
|
||||||
var executedAtomicBoolean = new AtomicBoolean(false);
|
var executedAtomicBoolean = new AtomicBoolean(false);
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ public class EasyClient {
|
|||||||
* Set the default callback for general updates (no response to requests).
|
* Set the default callback for general updates (no response to requests).
|
||||||
* @param receiveCallback Interface of callback for receive incoming update or request response.
|
* @param receiveCallback Interface of callback for receive incoming update or request response.
|
||||||
*/
|
*/
|
||||||
protected void setUpdateCallback(ReceiveCallback receiveCallback) {
|
public void setUpdateCallback(ReceiveCallback receiveCallback) {
|
||||||
ErrorCallback errorCallback = null;
|
ErrorCallback errorCallback = null;
|
||||||
CloseCallback closeCallback = null;
|
CloseCallback closeCallback = null;
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ public class EasyClient {
|
|||||||
* Set the default callback for general error updates (no response to requests).
|
* Set the default callback for general error updates (no response to requests).
|
||||||
* @param errorCallback Interface of callback for receive incoming error response.
|
* @param errorCallback Interface of callback for receive incoming error response.
|
||||||
*/
|
*/
|
||||||
protected void setErrorCallback(ErrorCallback errorCallback) {
|
public void setErrorCallback(ErrorCallback errorCallback) {
|
||||||
ReceiveCallback receiveCallback = null;
|
ReceiveCallback receiveCallback = null;
|
||||||
CloseCallback closeCallback = null;
|
CloseCallback closeCallback = null;
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ public class EasyClient {
|
|||||||
* Set the default callback for Tdlib closing notification.
|
* Set the default callback for Tdlib closing notification.
|
||||||
* @param closeCallback Interface of callback for receive notification of closing Tdlib.
|
* @param closeCallback Interface of callback for receive notification of closing Tdlib.
|
||||||
*/
|
*/
|
||||||
protected void setCloseCallback(CloseCallback closeCallback) {
|
public void setCloseCallback(CloseCallback closeCallback) {
|
||||||
ReceiveCallback receiveCallback = null;
|
ReceiveCallback receiveCallback = null;
|
||||||
ErrorCallback errorCallback = null;
|
ErrorCallback errorCallback = null;
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ public class EasyClient {
|
|||||||
/**
|
/**
|
||||||
* Destroys the client and TDLib instance.
|
* Destroys the client and TDLib instance.
|
||||||
*/
|
*/
|
||||||
protected void destroyBotClient() {
|
public void destroyBotClient() {
|
||||||
this.clientActor.destroyClientActor();
|
this.clientActor.destroyClientActor();
|
||||||
Log.setVerbosityLevel(5);
|
Log.setVerbosityLevel(5);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user