Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit c0ce3e7

Browse files
committed
Fix event publishing in TipeeeStreamListener
By casting all ADTs to their ADT base type we loose the newly added type information and because no handler listens for the base TipeeeeStreamEventJSON in the event input the TipeeeStreamEventInput was broken.
1 parent 8478eaf commit c0ce3e7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Diff for: src/main/scala/org/codeoverflow/chatoverflow/requirement/service/tipeeestream/TipeeestreamListener.scala

+6-8
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ class TipeeestreamListener extends EventManager {
1111
val event: JSONObject = json.getJSONObject("event")
1212
val eventType: String = event.getString("type")
1313

14-
val eventOption: Option[TipeeestreamEventJSON] = Option(eventType match {
15-
case "subscription" => SubscriptionEventJSON(event)
16-
case "donation" => DonationEventJSON(event)
17-
case "follow" => FollowEventJSON(event)
18-
case _ => null // gets None if converted to an option
14+
// Fire events for connector if we are looking for that type of event
15+
Option(eventType match {
16+
case "subscription" => call(SubscriptionEventJSON(event))
17+
case "donation" => call(DonationEventJSON(event))
18+
case "follow" => call(FollowEventJSON(event))
19+
case _ =>
1920
})
20-
21-
if (eventOption.isDefined)
22-
call(eventOption.get) // send event to connector
2321
}
2422
}

0 commit comments

Comments
 (0)