All Downloads are FREE. Search and download functionalities are using the official Maven repository.

im.actor.server.cli.UsersCliService.scala Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package im.actor.server.cli

import akka.actor.{ Props, Actor, ActorLogging }
import akka.cluster.client.ClusterClientReceptionist
import akka.pattern.pipe
import im.actor.server.user.UserExtension

object UsersCliService {
  def props = Props(new UsersCliService)
}

private final class UsersCliService extends Actor with ActorLogging {
  import context.dispatcher

  ClusterClientReceptionist(context.system).registerService(self)

  private val userExt = UserExtension(context.system)

  def receive = {
    case UpdateIsAdmin(userId, isAdmin) ⇒
      (for {
        _ ← userExt.updateIsAdmin(userId, isAdmin)
      } yield UpdateIsAdminResponse()) pipeTo sender()
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy