Skip to content

Commit

Permalink
clean unnecessary comments and no duplicated function.
Browse files Browse the repository at this point in the history
  • Loading branch information
marioosh committed Jun 25, 2015
1 parent 3964ece commit 71e8207
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
14 changes: 5 additions & 9 deletions src/main/scala/io/scalac/slack/bots/MessageListener.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@ package io.scalac.slack.bots

import akka.actor.{Actor, ActorLogging}
import io.scalac.slack.MessageEventBus
import io.scalac.slack.common.{Incoming, MessageEvent, Outgoing, RichOutboundMessage, _}
import io.scalac.slack.common.{Incoming, MessageEvent, Outgoing, _}

import scala.language.implicitConversions

/**
* Created on 08.02.15 23:52
*/
trait MessagePublisher {
// def bus = SlackBot.eventBus

def bus: MessageEventBus

def publish(event: MessageEvent) = {
bus.publish(event)
}
def publish(event: RichOutboundMessage) = {
implicit def publish(event: MessageEvent): Unit = {
bus.publish(event)
}

}

abstract class MessageListener extends Actor with ActorLogging with MessagePublisher
Expand Down
3 changes: 1 addition & 2 deletions src/main/scala/io/scalac/slack/websockets/WSActor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ import spray.can.server.UHttp
import spray.can.websocket.WebSocketClientWorker
import spray.can.websocket.frame.{CloseFrame, StatusCode, TextFrame}
import spray.http.{HttpHeaders, HttpMethods, HttpRequest}
import spray.json._

/**
* Created on 28.01.15 19:45
*/
class WSActor(eventBus: MessageEventBus) extends Actor with WebSocketClientWorker {

override def receive = connect orElse handshaking orElse closeLogic

// implicit val eventBus = SlackBot.eventBus
val out = context.actorOf(Props(classOf[OutgoingMessageProcessor], self, eventBus))
val in = context.actorOf(Props(classOf[IncomingMessageProcessor], eventBus))

Expand Down

0 comments on commit 71e8207

Please sign in to comment.