use of im.actor.core.viewmodel.CommandCallback in project actor-platform by actorapp.
the class JsFacade method clearChat.
@UsedByApp
public JsPromise clearChat(final JsPeer peer) {
return JsPromise.create(new JsPromiseExecutor() {
@Override
public void execute() {
messenger.clearChat(peer.convert()).start(new CommandCallback<Void>() {
@Override
public void onResult(Void res) {
Log.d(TAG, "clearChat:result");
resolve();
}
@Override
public void onError(Exception e) {
Log.d(TAG, "clearChat:error");
reject(e.getMessage());
}
});
}
});
}
use of im.actor.core.viewmodel.CommandCallback in project actor-platform by actorapp.
the class JsFacade method editMyNick.
@UsedByApp
public JsPromise editMyNick(final String newNick) {
return JsPromise.create(new JsPromiseExecutor() {
@Override
public void execute() {
//noinspection ConstantConditions
messenger.editMyNick(newNick).start(new CommandCallback<Boolean>() {
@Override
public void onResult(Boolean res) {
Log.d(TAG, "editMyNick:result");
resolve();
}
@Override
public void onError(Exception e) {
Log.d(TAG, "editMyNick:error");
reject(e.getMessage());
}
});
}
});
}
Aggregations