Search in sources :

Example 36 with Void

use of im.actor.runtime.actors.messages.Void in project actor-platform by actorapp.

the class JsFacade method kickMember.

@UsedByApp
public JsPromise kickMember(final int gid, final int uid) {
    return JsPromise.create(new JsPromiseExecutor() {

        @Override
        public void execute() {
            // noinspection ConstantConditions
            messenger.kickMember(gid, uid).start(new CommandCallback<Void>() {

                @Override
                public void onResult(Void res) {
                    Log.d(TAG, "kickMember:result");
                    resolve();
                }

                @Override
                public void onError(Exception e) {
                    Log.d(TAG, "kickMember:error");
                    reject(e.getMessage());
                }
            });
        }
    });
}
Also used : JsPromiseExecutor(im.actor.runtime.js.utils.JsPromiseExecutor) CommandCallback(im.actor.core.viewmodel.CommandCallback) Void(im.actor.runtime.actors.messages.Void) RpcException(im.actor.core.network.RpcException) UsedByApp(im.actor.core.js.annotations.UsedByApp)

Example 37 with Void

use of im.actor.runtime.actors.messages.Void in project actor-platform by actorapp.

the class JsFacade method inviteMember.

@UsedByApp
public JsPromise inviteMember(final int gid, final int uid) {
    return JsPromise.create(new JsPromiseExecutor() {

        @Override
        public void execute() {
            // noinspection ConstantConditions
            messenger.inviteMember(gid, uid).start(new CommandCallback<Void>() {

                @Override
                public void onResult(Void res) {
                    Log.d(TAG, "inviteMember:result");
                    resolve();
                }

                @Override
                public void onError(Exception e) {
                    Log.d(TAG, "inviteMember:error");
                    reject(e.getMessage());
                }
            });
        }
    });
}
Also used : JsPromiseExecutor(im.actor.runtime.js.utils.JsPromiseExecutor) CommandCallback(im.actor.core.viewmodel.CommandCallback) Void(im.actor.runtime.actors.messages.Void) RpcException(im.actor.core.network.RpcException) UsedByApp(im.actor.core.js.annotations.UsedByApp)

Aggregations

Void (im.actor.runtime.actors.messages.Void)37 ModuleContext (im.actor.core.modules.ModuleContext)16 ModuleActor (im.actor.core.modules.ModuleActor)15 RpcException (im.actor.core.network.RpcException)15 CommandCallback (im.actor.core.viewmodel.CommandCallback)15 ArrayList (java.util.ArrayList)15 List (java.util.List)13 Log (im.actor.runtime.Log)12 Promise (im.actor.runtime.promise.Promise)11 Peer (im.actor.core.entity.Peer)10 UsedByApp (im.actor.core.js.annotations.UsedByApp)9 JsPromiseExecutor (im.actor.runtime.js.utils.JsPromiseExecutor)9 Message (im.actor.core.entity.Message)8 UserVM (im.actor.core.viewmodel.UserVM)8 Update (im.actor.core.network.parser.Update)7 HashSet (java.util.HashSet)7 Group (im.actor.core.entity.Group)6 User (im.actor.core.entity.User)6 ApiSupportConfiguration (im.actor.core.modules.api.ApiSupportConfiguration)6 AlertDialog (android.app.AlertDialog)5