Skip to content

Commit

Permalink
Message refactor
Browse files Browse the repository at this point in the history
- renamed Ok to Connected message (used after successful connection)
- add Ok message as general purpose successful message type
  • Loading branch information
marioosh committed Jun 24, 2015
1 parent 0e4af56 commit 513cf4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/io/scalac/slack/api/ApiActor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import spray.json._
import scala.util.{Failure, Success}

/**
* Created on 21.01.15 20:32
* marioosh
*/
class ApiActor extends Actor with ActorLogging {

Expand All @@ -27,7 +27,7 @@ class ApiActor extends Actor with ActorLogging {
SlackApiClient.get[ApiTestResponse]("api.test", params) onComplete {
case Success(res) =>
if (res.ok) {
send ! Ok(res.args)
send ! Connected
}
else {
send ! ApiTestError
Expand Down
6 changes: 2 additions & 4 deletions src/main/scala/io/scalac/slack/api/Message.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ case object RegisterModules extends Message

//API CALLS
case class ApiTest(param: Option[String] = None, error: Option[String] = None) extends Message

case class AuthTest(token: APIKey) extends Message

case class RtmStart(token: APIKey) extends Message

//API RESPONSES
case class Ok(args: Option[Map[String, String]]) extends Message
case object Ok extends Message
case object Connected extends Message

case class AuthData(url: String, team: String, user: String, teamId: String, userId: String) extends Message

case class RtmData(url: String)

object AuthData {
Expand Down

0 comments on commit 513cf4c

Please sign in to comment.