use of im.actor.core.js.annotations.UsedByApp in project actor-platform by actorapp.
the class JsFacade method getInviteLink.
@UsedByApp
public JsPromise getInviteLink(final int gid) {
return JsPromise.create(new JsPromiseExecutor() {
@Override
public void execute() {
//noinspection ConstantConditions
messenger.requestInviteLink(gid).start(new CommandCallback<String>() {
@Override
public void onResult(String res) {
Log.d(TAG, "getInviteLink:result");
resolve(res);
}
@Override
public void onError(Exception e) {
Log.d(TAG, "getInviteLink:error");
reject(e.getMessage());
}
});
}
});
}
use of im.actor.core.js.annotations.UsedByApp in project actor-platform by actorapp.
the class JsFacade method findMentions.
@UsedByApp
public JsArray<JsMentionFilterResult> findMentions(int gid, String query) {
List<MentionFilterResult> res = messenger.findMentions(gid, query);
JsArray<JsMentionFilterResult> mentions = JsArray.createArray().cast();
for (MentionFilterResult m : res) {
mentions.push(JsMentionFilterResult.create(m));
}
return mentions;
}
use of im.actor.core.js.annotations.UsedByApp in project actor-platform by actorapp.
the class JsFacade method terminateAllSessions.
@UsedByApp
public JsPromise terminateAllSessions() {
return JsPromise.create(new JsPromiseExecutor() {
@Override
public void execute() {
messenger.terminateAllSessions().start(new CommandCallback<Void>() {
@Override
public void onResult(Void res) {
resolve();
}
@Override
public void onError(Exception e) {
Log.e(TAG, e);
reject(e.getMessage());
}
});
}
});
}
use of im.actor.core.js.annotations.UsedByApp in project actor-platform by actorapp.
the class JsFacade method editMyName.
// Profile
@UsedByApp
public JsPromise editMyName(final String newName) {
return JsPromise.create(new JsPromiseExecutor() {
@Override
public void execute() {
//noinspection ConstantConditions
messenger.editMyName(newName).start(new CommandCallback<Boolean>() {
@Override
public void onResult(Boolean res) {
Log.d(TAG, "editMyName:result");
resolve();
}
@Override
public void onError(Exception e) {
Log.d(TAG, "editMyName:error");
reject(e.getMessage());
}
});
}
});
}
use of im.actor.core.js.annotations.UsedByApp in project actor-platform by actorapp.
the class JsFacade method findAllLinks.
@UsedByApp
public JsPromise findAllLinks(final JsPeer peer) {
return JsPromise.create(new JsPromiseExecutor() {
@Override
public void execute() {
messenger.findAllLinks(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());
}
});
}
});
}
Aggregations