Search in sources :

Example 1 with MessageSearchEntity

use of im.actor.core.entity.MessageSearchEntity in project actor-platform by actorapp.

the class JsFacade method findAllPhotos.

@UsedByApp
public JsPromise findAllPhotos(final JsPeer peer) {
    return JsPromise.create(new JsPromiseExecutor() {

        @Override
        public void execute() {
            messenger.findAllPhotos(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());
                }
            });
        }
    });
}
Also used : JsPromiseExecutor(im.actor.runtime.js.utils.JsPromiseExecutor) MessageSearchEntity(im.actor.core.entity.MessageSearchEntity) List(java.util.List) ArrayList(java.util.ArrayList) CommandCallback(im.actor.core.viewmodel.CommandCallback) RpcException(im.actor.core.network.RpcException) UsedByApp(im.actor.core.js.annotations.UsedByApp)

Example 2 with MessageSearchEntity

use of im.actor.core.entity.MessageSearchEntity in project actor-platform by actorapp.

the class JsFacade method findAllText.

@UsedByApp
public JsPromise findAllText(final JsPeer peer, final String query) {
    return JsPromise.create(new JsPromiseExecutor() {

        @Override
        public void execute() {
            messenger.findTextMessages(peer.convert(), query).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());
                }
            });
        }
    });
}
Also used : JsPromiseExecutor(im.actor.runtime.js.utils.JsPromiseExecutor) MessageSearchEntity(im.actor.core.entity.MessageSearchEntity) List(java.util.List) ArrayList(java.util.ArrayList) CommandCallback(im.actor.core.viewmodel.CommandCallback) RpcException(im.actor.core.network.RpcException) UsedByApp(im.actor.core.js.annotations.UsedByApp)

Example 3 with MessageSearchEntity

use of im.actor.core.entity.MessageSearchEntity 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());
                }
            });
        }
    });
}
Also used : JsPromiseExecutor(im.actor.runtime.js.utils.JsPromiseExecutor) MessageSearchEntity(im.actor.core.entity.MessageSearchEntity) List(java.util.List) ArrayList(java.util.ArrayList) CommandCallback(im.actor.core.viewmodel.CommandCallback) RpcException(im.actor.core.network.RpcException) UsedByApp(im.actor.core.js.annotations.UsedByApp)

Example 4 with MessageSearchEntity

use of im.actor.core.entity.MessageSearchEntity 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());
                }
            });
        }
    });
}
Also used : JsPromiseExecutor(im.actor.runtime.js.utils.JsPromiseExecutor) MessageSearchEntity(im.actor.core.entity.MessageSearchEntity) List(java.util.List) ArrayList(java.util.ArrayList) CommandCallback(im.actor.core.viewmodel.CommandCallback) RpcException(im.actor.core.network.RpcException) UsedByApp(im.actor.core.js.annotations.UsedByApp)

Aggregations

MessageSearchEntity (im.actor.core.entity.MessageSearchEntity)4 UsedByApp (im.actor.core.js.annotations.UsedByApp)4 RpcException (im.actor.core.network.RpcException)4 CommandCallback (im.actor.core.viewmodel.CommandCallback)4 JsPromiseExecutor (im.actor.runtime.js.utils.JsPromiseExecutor)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4