Search in sources :

Example 1 with BannedUser

use of org.matrix.androidsdk.rest.model.BannedUser in project matrix-android-sdk by matrix-org.

the class Room method ban.

/**
 * Ban a user from the room.
 *
 * @param userId   the user id
 * @param reason   ban reason
 * @param callback the async callback
 */
public void ban(String userId, String reason, ApiCallback<Void> callback) {
    BannedUser user = new BannedUser();
    user.userId = userId;
    if (!TextUtils.isEmpty(reason)) {
        user.reason = reason;
    }
    mDataHandler.getDataRetriever().getRoomsRestClient().banFromRoom(getRoomId(), user, callback);
}
Also used : BannedUser(org.matrix.androidsdk.rest.model.BannedUser)

Example 2 with BannedUser

use of org.matrix.androidsdk.rest.model.BannedUser in project matrix-android-sdk by matrix-org.

the class Room method unban.

/**
 * Unban a user.
 *
 * @param userId   the user id
 * @param callback the async callback
 */
public void unban(String userId, ApiCallback<Void> callback) {
    BannedUser user = new BannedUser();
    user.userId = userId;
    mDataHandler.getDataRetriever().getRoomsRestClient().unbanFromRoom(getRoomId(), user, callback);
}
Also used : BannedUser(org.matrix.androidsdk.rest.model.BannedUser)

Aggregations

BannedUser (org.matrix.androidsdk.rest.model.BannedUser)2