Search in sources :

Example 1 with JsBlockedUser

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

the class JsBindingModule method getUserBlocked.

public JsBindedValue<JsBlockedUser> getUserBlocked(int uid) {
    if (!usersBloked.containsKey(uid)) {
        final JsBindedValue<JsBlockedUser> value = new JsBindedValue<>();
        final UserVM userVM = context().getUsersModule().getUsers().get(uid);
        userVM.getIsBlocked().subscribe(new ValueChangedListener<Boolean>() {

            @Override
            public void onChanged(Boolean val, Value<Boolean> valueModel) {
                value.changeValue(JsBlockedUser.create(val));
            }
        });
        usersBloked.put(uid, value);
    }
    return usersBloked.get(uid);
}
Also used : UserVM(im.actor.core.viewmodel.UserVM) JsBlockedUser(im.actor.core.js.entity.JsBlockedUser)

Aggregations

JsBlockedUser (im.actor.core.js.entity.JsBlockedUser)1 UserVM (im.actor.core.viewmodel.UserVM)1