Presently the Listener class assumes all types of listeners are interested in ACTIVATE_CHAT_COMPLETE_RESULT and SET_STAGED_MESSAGE and provides stub methods to handle each. The proposal here is to make Listener agnostic to which events it listens to. A listener should maintain a list of events (set on initialization) and, when prompted, begin listening on the appropriate emitter (specified by the event). The base Listener class can provide a single handleEvent() method which can then be overridden by subclasses.
Presently the
Listener
class assumes all types of listeners are interested inACTIVATE_CHAT_COMPLETE_RESULT
andSET_STAGED_MESSAGE
and provides stub methods to handle each. The proposal here is to makeListener
agnostic to which events it listens to. A listener should maintain a list of events (set on initialization) and, when prompted, begin listening on the appropriate emitter (specified by the event). The baseListener
class can provide a singlehandleEvent()
method which can then be overridden by subclasses.If accepted, this would block https://github.com/other-xyz/other.js/issues/122 as message actions (text results) would be provided by a
SelectedMessageListener
class.cc @tonygentilcore