use of im.actor.core.js.annotations.UsedByApp in project actor-platform by actorapp.
the class JsFacade method addContact.
@UsedByApp
public JsPromise addContact(final int uid) {
return JsPromise.create(new JsPromiseExecutor() {
@Override
public void execute() {
//noinspection ConstantConditions
messenger.addContact(uid).start(new CommandCallback<Boolean>() {
@Override
public void onResult(Boolean res) {
Log.d(TAG, "addContact:result");
resolve();
}
@Override
public void onError(Exception e) {
Log.d(TAG, "addContact:error");
reject(e.getMessage());
}
});
}
});
}
use of im.actor.core.js.annotations.UsedByApp in project actor-platform by actorapp.
the class JsFacade method getIntegrationToken.
@UsedByApp
public JsPromise getIntegrationToken(final int gid) {
return JsPromise.create(new JsPromiseExecutor() {
@Override
public void execute() {
//noinspection ConstantConditions
messenger.requestIntegrationToken(gid).start(new CommandCallback<String>() {
@Override
public void onResult(String res) {
Log.d(TAG, "getIntegrationToken:result");
resolve(res);
}
@Override
public void onError(Exception e) {
Log.d(TAG, "getIntegrationToken:error");
reject(e.getMessage());
}
});
}
});
}
use of im.actor.core.js.annotations.UsedByApp in project actor-platform by actorapp.
the class JsFacade method findAllDocs.
@UsedByApp
public JsPromise findAllDocs(final JsPeer peer) {
return JsPromise.create(new JsPromiseExecutor() {
@Override
public void execute() {
messenger.findAllDocs(peer.convert()).start(new CommandCallback<List<MessageSearchEntity>>() {
@Override
public void onResult(List<MessageSearchEntity> res) {
resolve(convertSearchRes(res));
}
@Override
public void onError(Exception e) {
Log.d(TAG, "findAllText:error");
reject(e.getMessage());
}
});
}
});
}
use of im.actor.core.js.annotations.UsedByApp in project actor-platform by actorapp.
the class JsFacade method revokeIntegrationToken.
@UsedByApp
public JsPromise revokeIntegrationToken(final int gid) {
return JsPromise.create(new JsPromiseExecutor() {
@Override
public void execute() {
//noinspection ConstantConditions
messenger.revokeIntegrationToken(gid).start(new CommandCallback<String>() {
@Override
public void onResult(String res) {
Log.d(TAG, "revokeIntegrationToken:result");
resolve(res);
}
@Override
public void onError(Exception e) {
Log.d(TAG, "revokeIntegrationToken:error");
reject(e.getMessage());
}
});
}
});
}
use of im.actor.core.js.annotations.UsedByApp in project actor-platform by actorapp.
the class JsFacade method editMyAbout.
@UsedByApp
public JsPromise editMyAbout(final String newAbout) {
return JsPromise.create(new JsPromiseExecutor() {
@Override
public void execute() {
//noinspection ConstantConditions
messenger.editMyAbout(newAbout).start(new CommandCallback<Boolean>() {
@Override
public void onResult(Boolean res) {
Log.d(TAG, "editMyAbout:result");
resolve();
}
@Override
public void onError(Exception e) {
Log.d(TAG, "editMyAbout:error");
reject(e.getMessage());
}
});
}
});
}
Aggregations